Skip navigation links


org.identityconnectors.framework.common.objects
Class AttributeInfoBuilder

java.lang.Object
  extended by org.identityconnectors.framework.common.objects.AttributeInfoBuilder


public final class AttributeInfoBuilder
extends java.lang.Object

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
Version:
$Revision: /main/2 $
Author:
Will Droste

Constructor Summary
AttributeInfoBuilder()
          Creates an builder with all the defaults set.
AttributeInfoBuilder(java.lang.String name)
          Creates an builder with all the defaults set.
AttributeInfoBuilder(java.lang.String name, java.lang.Class<?> type)
          Creates an builder with all the defaults set.

 

Method Summary
 AttributeInfo build()
          Builds an AttributeInfo object based on the properties set.
static AttributeInfo build(java.lang.String name)
          Convenience method to create an AttributeInfo.
static AttributeInfo build(java.lang.String name, java.lang.Class<?> type)
          Convenience method to create an AttributeInfo.
static AttributeInfo build(java.lang.String name, java.lang.Class<?> type, java.util.Set<AttributeInfo.Flags> flags)
          Convenience method to create an AttributeInfo.
static AttributeInfo buildCurrentAttributes(java.lang.String objectClassName)
          Convenience method to create AttributeInfo for CURRENT_ATTRIBUTES operational attribute.
 AttributeInfoBuilder setCreateable(boolean value)
          Determines if the attribute is writable.
 AttributeInfoBuilder setFlags(java.util.Set<AttributeInfo.Flags> flags)
          Sets all of the flags for this builder.
 AttributeInfoBuilder setMultiValued(boolean value)
          Determines if this attribute supports multivalue.
 AttributeInfoBuilder setName(java.lang.String name)
          Sets the unique name of the AttributeInfo object.
 AttributeInfoBuilder setObjectClassName(java.lang.String objectClassName)
          For attributes that hold an embedded object, sets the name of the object class representing that 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 setType(java.lang.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.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

AttributeInfoBuilder

public AttributeInfoBuilder()
Creates an builder with all the defaults set. The name must be set before the 'build' method is called otherwise an IllegalStateException is thrown.
 Name: <not set>
 Readable: true
 Writeable: true
 Required: false
 Type: string
 MultiValue: false
 

AttributeInfoBuilder

public AttributeInfoBuilder(java.lang.String name)
Creates an builder with all the defaults set. The name must be set before the 'build' method is called otherwise an IllegalStateException is thrown.
 Name: <not set>
 Readable: true
 Writeable: true
 Required: false
 Type: string
 MultiValue: false
 

AttributeInfoBuilder

public AttributeInfoBuilder(java.lang.String name,
                            java.lang.Class<?> type)
Creates an builder with all the defaults set. The name must be set before the 'build' method is called otherwise an IllegalStateException is thrown.
 Name: <not set>
 Readable: true
 Writeable: true
 Required: false
 Type: string
 MultiValue: false
 

Method Detail

build

public AttributeInfo build()
Builds an AttributeInfo object based on the properties set.
Returns:
AttributeInfo based on the properties set.

setName

public AttributeInfoBuilder setName(java.lang.String name)
Sets the unique name of the AttributeInfo object.
Parameters:
name - unique name of the AttributeInfo object.

setType

public AttributeInfoBuilder setType(java.lang.Class<?> value)
Please see FrameworkUtil.checkAttributeType(Class) for the definitive list of supported types.
Parameters:
value - type for an Attribute's value.
Throws:
java.lang.IllegalArgumentException - if the Class is not a supported type.

setObjectClassName

public AttributeInfoBuilder setObjectClassName(java.lang.String objectClassName)
For attributes that hold an embedded object, sets the name of the object class representing that object.
Parameters:
objectClassName - the name of the object class.
Since:
1.2

setReadable

public AttributeInfoBuilder setReadable(boolean value)
Determines if the attribute is readable.

setCreateable

public AttributeInfoBuilder setCreateable(boolean value)
Determines if the attribute is writable.

setRequired

public AttributeInfoBuilder setRequired(boolean value)
Determines if this attribute is required.

setMultiValued

public AttributeInfoBuilder setMultiValued(boolean value)
Determines if this attribute supports multivalue.

setUpdateable

public AttributeInfoBuilder setUpdateable(boolean value)
Determines if this attribute writable during update.

setReturnedByDefault

public AttributeInfoBuilder setReturnedByDefault(boolean value)

setFlags

public AttributeInfoBuilder setFlags(java.util.Set<AttributeInfo.Flags> flags)
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:

  • updateable
  • creatable
  • returned by default
  • readable
  • single-valued
  • optional

build

public static AttributeInfo build(java.lang.String name,
                                  java.lang.Class<?> type,
                                  java.util.Set<AttributeInfo.Flags> flags)
Convenience method to create an AttributeInfo. Equivalent to new AttributeInfoBuilder(name,type).setFlags(flags).build()
Parameters:
name - The name of the attribute
type - The type of the attribute
flags - The flags for the attribute. Null means clear all flags
Returns:
The attribute info

build

public static AttributeInfo build(java.lang.String name,
                                  java.lang.Class<?> type)
Convenience method to create an AttributeInfo. Equivalent to AttributeInfoBuilder.build(name,type,null)
Parameters:
name - The name of the attribute
type - The type of the attribute
Returns:
The attribute info

build

public static AttributeInfo build(java.lang.String name)
Convenience method to create an AttributeInfo. Equivalent to AttributeInfoBuilder.build(name,type)
Parameters:
name - The name of the attribute
Returns:
The attribute info

buildCurrentAttributes

public static AttributeInfo buildCurrentAttributes(java.lang.String objectClassName)
Convenience method to create AttributeInfo for CURRENT_ATTRIBUTES operational attribute. For more info see OperationalAttributes.CURRENT_ATTRIBUTES
Parameters:
objectClassName - Object class name
Returns:
The attribute info

Skip navigation links


Copyright © 2013, Oracle and/or its affiliates. All rights reserved.