public final class AttributeInfoBuilder extends Object
AttributeInfo
.
AttributeInfoBuilder bld = new AttributeInfoBuilder("email");
bld.setRequired(true);
AttributeInfo info = bld.build();
Constructor and Description |
---|
AttributeInfoBuilder()
Creates an builder with all the defaults set.
|
AttributeInfoBuilder(String name)
Creates an builder with all the defaults set.
|
AttributeInfoBuilder(String name,
Class<?> type)
Creates an builder with all the defaults set.
|
Modifier and Type | Method and Description |
---|---|
AttributeInfo |
build()
Builds an
AttributeInfo object based on the properties set. |
static AttributeInfo |
build(String name)
Convenience method to create an AttributeInfo.
|
static AttributeInfo |
build(String name,
Class<?> type)
Convenience method to create an AttributeInfo.
|
static AttributeInfo |
build(String name,
Class<?> type,
Set<AttributeInfo.Flags> flags)
Convenience method to create an AttributeInfo.
|
static AttributeInfoBuilder |
define(String name)
Convenience method to create a new AttributeInfoBuilder.
|
static AttributeInfoBuilder |
define(String name,
Class<?> type)
Convenience method to create a new AttributeInfoBuilder.
|
AttributeInfoBuilder |
setCreateable(boolean value)
Determines if the attribute is writable.
|
AttributeInfoBuilder |
setFlags(Set<AttributeInfo.Flags> flags)
Sets all of the flags for this builder.
|
AttributeInfoBuilder |
setMultiValued(boolean value)
Determines if this attribute supports multivalue.
|
AttributeInfoBuilder |
setName(String name)
Sets the unique name of the
AttributeInfo object. |
AttributeInfoBuilder |
setNativeName(String nativeName)
Sets the native name of the
AttributeInfo object. |
AttributeInfoBuilder |
setReadable(boolean value)
Determines if the attribute is readable.
|
AttributeInfoBuilder |
setRequired(boolean value)
Determines if this attribute is required.
|
AttributeInfoBuilder |
setReturnedByDefault(boolean value) |
AttributeInfoBuilder |
setSubtype(AttributeInfo.Subtypes subtype) |
AttributeInfoBuilder |
setSubtype(String subtype)
Optional subtype of the attribute.
|
AttributeInfoBuilder |
setType(Class<?> value)
Please see
FrameworkUtil.checkAttributeType(Class) for the
definitive list of supported types. |
AttributeInfoBuilder |
setUpdateable(boolean value)
Determines if this attribute writable during update.
|
public AttributeInfoBuilder()
IllegalStateException
is thrown.
Name: <not set> Readable: true Writeable: true Required: false Type: string MultiValue: false
public AttributeInfoBuilder(String name)
IllegalStateException
is thrown.
Name: <not set> Readable: true Writeable: true Required: false Type: string MultiValue: false
public AttributeInfoBuilder(String name, Class<?> type)
IllegalStateException
is thrown.
Name: <not set> Readable: true Writeable: true Required: false Type: string MultiValue: false
public AttributeInfo build()
AttributeInfo
object based on the properties set.AttributeInfo
based on the properties set.public AttributeInfoBuilder setName(String name)
AttributeInfo
object.name
- unique name of the AttributeInfo
object.public AttributeInfoBuilder setType(Class<?> value)
FrameworkUtil.checkAttributeType(Class)
for the
definitive list of supported types.value
- type for an Attribute
's value.IllegalArgumentException
- if the Class is not a supported type.public AttributeInfoBuilder setSubtype(String subtype)
AttributeInfo#Subtypes
for the list of pre-defined subtypes.subtype
- subtype for an Attribute
's value.public AttributeInfoBuilder setSubtype(AttributeInfo.Subtypes subtype)
public AttributeInfoBuilder setNativeName(String nativeName)
AttributeInfo
object.nativeName
- native name of the AttributeInfo
object.public AttributeInfoBuilder setReadable(boolean value)
public AttributeInfoBuilder setCreateable(boolean value)
public AttributeInfoBuilder setRequired(boolean value)
public AttributeInfoBuilder setMultiValued(boolean value)
public AttributeInfoBuilder setUpdateable(boolean value)
public AttributeInfoBuilder setReturnedByDefault(boolean value)
public AttributeInfoBuilder setFlags(Set<AttributeInfo.Flags> flags)
flags
- The set of attribute info flags. Null means clear all flags.
NOTE: EnumSet.noneOf(AttributeInfo.Flags.class) results in an attribute with the default behavior:
public static AttributeInfo build(String name, Class<?> type, Set<AttributeInfo.Flags> flags)
new AttributeInfoBuilder(name,type).setFlags(flags).build()
name
- The name of the attributetype
- The type of the attributeflags
- The flags for the attribute. Null means clear all flagspublic static AttributeInfo build(String name, Class<?> type)
AttributeInfoBuilder.build(name,type,null)
name
- The name of the attributetype
- The type of the attributepublic static AttributeInfo build(String name)
AttributeInfoBuilder.build(name, String.class)
name
- The name of the attributepublic static AttributeInfoBuilder define(String name)
new AttributeInfoBuilder(name, String.class)
name
- The name of the attributepublic static AttributeInfoBuilder define(String name, Class<?> type)
new AttributeInfoBuilder(name, type)
name
- The name of the attributetype
- The type of the attributeCopyright © 2022. All rights reserved.