public static final class FileAttributeViewMetadata.Builder extends Object
FileAttributeViewMetadata
objects.Modifier and Type | Method and Description |
---|---|
FileAttributeViewMetadata |
build()
Creates a
FileAttributeViewMetadata object with the attributes added to this builder. |
static Type |
returnType(Class<?> declaringType,
String methodName,
Class<?>... parameterTypes)
Returns a
Type representing the return type of an existing public method. |
FileAttributeViewMetadata.Builder |
withAttribute(String attributeName,
Type attributeType)
Adds a single attribute that is both readable and writable.
|
FileAttributeViewMetadata.Builder |
withAttribute(String attributeName,
Type attributeType,
FileAttributeViewMetadata.Operation firstOperation,
FileAttributeViewMetadata.Operation... additionalOperations)
Adds a single attribute that is only supported for specific operations.
|
FileAttributeViewMetadata.Builder |
withAttributes(FileAttributeViewMetadata view)
Adds all attributes of another
FileAttributeViewMetadata object. |
FileAttributeViewMetadata.Builder |
withViewName(String viewName)
Sets the view name to use.
|
public FileAttributeViewMetadata.Builder withViewName(String viewName)
FileAttributeView
, the part before it in camel case.AttributeView
, the part before it in camel case.View
, the part before it in camel case.viewName
- The view name to use.NullPointerException
- If the given view name is null
.IllegalArgumentException
- If the given view name is empty
.public FileAttributeViewMetadata.Builder withAttribute(String attributeName, Type attributeType)
attributeName
- The name of the attribute to add.attributeType
- The type of the attribute to add. This should usually be a class literal,
or the result of calling returnType(Class, String, Class...)
for generic types.NullPointerException
- If the given attribute name or type is null
.public FileAttributeViewMetadata.Builder withAttribute(String attributeName, Type attributeType, FileAttributeViewMetadata.Operation firstOperation, FileAttributeViewMetadata.Operation... additionalOperations)
attributeName
- The name of the attribute to add.attributeType
- The type of the attribute to add. This should usually be a class literal,
or the result of calling returnType(Class, String, Class...)
for generic types.firstOperation
- The first operation for which the attribute is supported.additionalOperations
- Zero or more additional operations for which the attribute is supported.NullPointerException
- If the given attribute name or type or any of the operations is null
.public FileAttributeViewMetadata.Builder withAttributes(FileAttributeViewMetadata view)
FileAttributeViewMetadata
object.
This can be used when one FileAttributeView
interface extends from another.view
- The FileAttributeViewMetadata
object to add all attributes of.NullPointerException
- If the given FileAttributeViewMetadata
object is null
.public FileAttributeViewMetadata build()
FileAttributeViewMetadata
object with the attributes added to this builder.FileAttributeViewMetadata
object.public static Type returnType(Class<?> declaringType, String methodName, Class<?>... parameterTypes)
Type
representing the return type of an existing public method.declaringType
- The class or interface where the method is declared.methodName
- The name of the method.parameterTypes
- The parameter types of the method.Type
representing the return type of the requested method.NullPointerException
- If the given declaring type or method name is null
.IllegalArgumentException
- If the requested method does not exist.Copyright © 2016–2023. All rights reserved.