Class AttributeInfoBuilder
java.lang.Object
org.identityconnectors.framework.common.objects.AttributeInfoBuilder
Simplifies the process of building 'AttributeInfo' objects. This class is
responsible for providing a default implementation of
AttributeInfo
.
AttributeInfoBuilder bld = new AttributeInfoBuilder("email");
bld.setRequired(true);
AttributeInfo info = bld.build();
- Since:
- 1.0
-
Constructor Summary
ConstructorDescriptionCreates 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. -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds anAttributeInfo
object based on the properties set.static AttributeInfo
Convenience method to create an AttributeInfo.static AttributeInfo
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
Convenience method to create a new AttributeInfoBuilder.static AttributeInfoBuilder
Convenience method to create a new AttributeInfoBuilder.setCreateable
(boolean value) Determines if the attribute is writable.setFlags
(Set<AttributeInfo.Flags> flags) Sets all of the flags for this builder.setMultiValued
(boolean value) Determines if this attribute supports multivalue.Sets the unique name of theAttributeInfo
object.setReadable
(boolean value) Determines if the attribute is readable.setRequired
(boolean value) Determines if this attribute is required.setReturnedByDefault
(boolean value) Please seeFrameworkUtil.checkAttributeType(Class)
for the definitive list of supported types.setUpdateable
(boolean value) Determines if this attribute writable during update.
-
Constructor Details
-
AttributeInfoBuilder
public AttributeInfoBuilder()Creates an builder with all the defaults set. The name must be set before the 'build' method is called otherwise anIllegalStateException
is thrown.Name: <not set> Readable: true Writeable: true Required: false Type: string MultiValue: false
-
AttributeInfoBuilder
Creates an builder with all the defaults set. The name must be set before the 'build' method is called otherwise anIllegalStateException
is thrown.Name: <not set> Readable: true Writeable: true Required: false Type: string MultiValue: false
-
AttributeInfoBuilder
Creates an builder with all the defaults set. The name must be set before the 'build' method is called otherwise anIllegalStateException
is thrown.Name: <not set> Readable: true Writeable: true Required: false Type: string MultiValue: false
-
-
Method Details
-
build
Builds anAttributeInfo
object based on the properties set.- Returns:
AttributeInfo
based on the properties set.
-
setName
Sets the unique name of theAttributeInfo
object.- Parameters:
name
- unique name of theAttributeInfo
object.
-
setType
Please seeFrameworkUtil.checkAttributeType(Class)
for the definitive list of supported types.- Parameters:
value
- type for anAttribute
's value.- Throws:
IllegalArgumentException
- if the Class is not a supported type.
-
setReadable
Determines if the attribute is readable. -
setCreateable
Determines if the attribute is writable. -
setRequired
Determines if this attribute is required. -
setMultiValued
Determines if this attribute supports multivalue. -
setUpdateable
Determines if this attribute writable during update. -
setReturnedByDefault
-
setFlags
Sets all of the flags for this builder.- Parameters:
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:
- update-able
- creatable
- returned by default
- readable
- single-valued
- optional
-
build
Convenience method to create an AttributeInfo. Equivalent tonew AttributeInfoBuilder(name,type).setFlags(flags).build()
- Parameters:
name
- The name of the attributetype
- The type of the attributeflags
- The flags for the attribute. Null means clear all flags- Returns:
- The attribute info
-
build
Convenience method to create an AttributeInfo. Equivalent toAttributeInfoBuilder.build(name,type,null)
- Parameters:
name
- The name of the attributetype
- The type of the attribute- Returns:
- The attribute info
-
build
Convenience method to create an AttributeInfo. Equivalent toAttributeInfoBuilder.build(name, String.class)
- Parameters:
name
- The name of the attribute- Returns:
- The attribute info
-
define
Convenience method to create a new AttributeInfoBuilder. Equivalent to:new AttributeInfoBuilder(name, String.class)
- Parameters:
name
- The name of the attribute- Returns:
- The attribute info builder with predefined name and type value.
- Since:
- 1.4
-
define
Convenience method to create a new AttributeInfoBuilder. Equivalent to:new AttributeInfoBuilder(name, type)
- Parameters:
name
- The name of the attributetype
- The type of the attribute- Returns:
- The attribute info builder with predefined name and type value.
- Since:
- 1.4
-