de.smartics.properties.spi.core.metadata
Class PropertyMetaData.Builder

Package class diagram package PropertyMetaData.Builder
java.lang.Object
  extended by de.smartics.properties.spi.core.metadata.PropertyMetaData.Builder
Enclosing class:
PropertyMetaData

public static final class PropertyMetaData.Builder
     
     
extends Object

Creates instances of type PropertyMetaData.


Constructor Summary
PropertyMetaData.Builder()
           
 
Method Summary
 void add(PropertyConstraint<?> constraint)
          Adds the given constraint to the list of constraints.
 PropertyMetaData build()
          Creates the instance.
 PropertyKey getKey()
          Returns the key of the property.
 PropertyType getType()
          Returns the type of the property value.
 void setSecured(boolean secured)
          Sets the flag to determine whether or not the property value contains sensitive information that is required to be secured.
 PropertyMetaData.Builder with(AccessType accessType)
          Sets the flag to define the access type.
 PropertyMetaData.Builder with(DocumentMetaDataProxy documentMetaData)
          Sets the meta data information for the property.
 PropertyMetaData.Builder with(PropertyCategories categories)
          Sets the categories the property is associated with.
 PropertyMetaData.Builder with(PropertyCommentProvider commentProxy)
          Sets the comment proxy to the property and its values.
 PropertyMetaData.Builder with(PropertyContextProvider context)
          Sets the context of the property descriptor.
 PropertyMetaData.Builder with(PropertyDefinitionTime configurationTime)
          Sets the designed time the property is defined.
 PropertyMetaData.Builder with(PropertyExpression defaultExpression)
          Sets the default expression to evaluate a default property value.
 PropertyMetaData.Builder with(PropertyKey key)
          Sets the key of the property.
 PropertyMetaData.Builder with(PropertyType type)
          Sets the type of the property value.
 PropertyMetaData.Builder with(PropertyUse.UseType useType)
          Sets the use type of the property.
 PropertyMetaData.Builder with(PropertyValueRange<?> valueRange)
          Sets the range of values allowed for this property.
 PropertyMetaData.Builder withDeclaringType(Class<?> declaringType)
          Sets the type that declares the property that is described by this instance.
 PropertyMetaData.Builder withUpdateIntervalInMs(long updateIntervalInMs)
          Sets the update interval in milliseconds (ms).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyMetaData.Builder

public PropertyMetaData.Builder()
Method Detail

getKey

public PropertyKey getKey()
Returns the key of the property.

Returns:
the key of the property. May be null if not yet set to the builder.

getType

public PropertyType getType()
Returns the type of the property value.

Returns:
the type of the property value. May be null if not yet set to the builder.

with

public PropertyMetaData.Builder with(PropertyContextProvider context)
                              throws NullPointerException
Sets the context of the property descriptor.

Parameters:
context - the context of the property descriptor.
Returns:
the builder instance.
Throws:
NullPointerException - if context is null.

setSecured

public void setSecured(boolean secured)
Sets the flag to determine whether or not the property value contains sensitive information that is required to be secured.

Parameters:
secured - the flag to determine whether or not the property value contains sensitive information that is required to be secured.

withDeclaringType

public PropertyMetaData.Builder withDeclaringType(Class<?> declaringType)
                                           throws NullPointerException
Sets the type that declares the property that is described by this instance.

Parameters:
declaringType - the type that declares the property that is described by this instance.
Returns:
the builder instance.
Throws:
NullPointerException - if declaringType is null.

with

public PropertyMetaData.Builder with(PropertyKey key)
                              throws NullPointerException
Sets the key of the property. Must not be null.

Parameters:
key - the key of the property.
Returns:
the builder instance.
Throws:
NullPointerException - if key is null.

with

public PropertyMetaData.Builder with(PropertyType type)
                              throws NullPointerException
Sets the type of the property value. Must not be null.

Parameters:
type - the type of the property value.
Returns:
the builder instance.
Throws:
NullPointerException - if type is null.

with

public PropertyMetaData.Builder with(AccessType accessType)
                              throws NullPointerException
Sets the flag to define the access type.

Parameters:
accessType - the flag to define the access type.
Returns:
the builder instance.
Throws:
NullPointerException - if accessType is null.

withUpdateIntervalInMs

public PropertyMetaData.Builder withUpdateIntervalInMs(long updateIntervalInMs)
Sets the update interval in milliseconds (ms).

An application may cache the value of the property for the given period of time.

value description
< 0 Property is not mutable.
0 Property is required on each access.
> 0 Property is required to be read new after the given number of ms elapsed.

Parameters:
updateIntervalInMs - the update interval in milliseconds (ms).
Returns:
the builder instance.

with

public PropertyMetaData.Builder with(PropertyDefinitionTime configurationTime)
                              throws NullPointerException
Sets the designed time the property is defined.

Parameters:
configurationTime - the designed time the property is defined.
Returns:
the builder instance.
Throws:
NullPointerException - if defaultExpression is null.

with

public PropertyMetaData.Builder with(PropertyExpression defaultExpression)
                              throws NullPointerException
Sets the default expression to evaluate a default property value. May be null.

Parameters:
defaultExpression - the default expression to evaluate a default property value.
Returns:
the builder instance.
Throws:
NullPointerException - if defaultExpression is null.

with

public PropertyMetaData.Builder with(PropertyValueRange<?> valueRange)
Sets the range of values allowed for this property.

Parameters:
valueRange - the range of values allowed for this property.
Returns:
the builder instance.

with

public PropertyMetaData.Builder with(DocumentMetaDataProxy documentMetaData)
                              throws NullPointerException
Sets the meta data information for the property.

Parameters:
documentMetaData - the meta data information for the property.
Returns:
the builder instance.
Throws:
NullPointerException - if documentMetaData is null.

with

public PropertyMetaData.Builder with(PropertyCommentProvider commentProxy)
                              throws NullPointerException
Sets the comment proxy to the property and its values.

Parameters:
commentProxy - the comment proxy to the property and its values.
Returns:
the builder instance.
Throws:
NullPointerException - if commentProxy is null .

add

public void add(PropertyConstraint<?> constraint)
         throws NullPointerException
Adds the given constraint to the list of constraints.

Parameters:
constraint - the constraint to add.
Throws:
NullPointerException - if constraint is null.

with

public PropertyMetaData.Builder with(PropertyCategories categories)
                              throws NullPointerException
Sets the categories the property is associated with.

Parameters:
categories - the categories the property is associated with.
Returns:
the builder instance.
Throws:
NullPointerException - if categories is null.

with

public PropertyMetaData.Builder with(PropertyUse.UseType useType)
                              throws NullPointerException
Sets the use type of the property.

Parameters:
useType - the use type of the property.
Returns:
the builder instance.
Throws:
NullPointerException - if useType is null.

build

public PropertyMetaData build()
                       throws NullPointerException
Creates the instance.

Returns:
the created instance.
Throws:
NullPointerException - if any of the required arguments is not set.


Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.