de.smartics.properties.api.config.domain
Class PropertyIndex

Package class diagram package PropertyIndex
java.lang.Object
  extended by de.smartics.properties.api.config.domain.PropertyIndex
All Implemented Interfaces:
Serializable

@NotThreadSafe
public final class PropertyIndex
     
     
extends Object
implements Serializable

A index of property key to the full property information and the descriptor of the property.

See Also:
Serialized Form

Constructor Summary
PropertyIndex(ConfigurationKey<?> configurationKey)
          Default constructor.
 
Method Summary
 PropertyDefinition get(String propertyName)
          Returns the property definition for the given property name.
 ConfigurationKey<?> getConfigurationKey()
          Returns the key to the configuration the properties are part of.
 boolean isEmpty()
          Checks if the index contains at least one property.
 void register(PropertyDescriptor descriptor, Property property)
          Registers the property descriptor and property instance to the index.
 String toString()
          Returns the string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyIndex

public PropertyIndex(@NotNull
                     ConfigurationKey<?> configurationKey)
              throws de.smartics.util.lang.NullArgumentException
Default constructor.

Parameters:
configurationKey - the key to the configuration the properties are part of.
Throws:
de.smartics.util.lang.NullArgumentException - if ConfigurationKey is null.
Method Detail

getConfigurationKey

public ConfigurationKey<?> getConfigurationKey()
Returns the key to the configuration the properties are part of.

Returns:
the key to the configuration the properties are part of.

register

public void register(PropertyDescriptor descriptor,
                     Property property)
              throws de.smartics.util.lang.NullArgumentException,
                     IllegalArgumentException,
                     DuplicatePropertyDefinitionException
Registers the property descriptor and property instance to the index.

Parameters:
descriptor - the descriptor of the property.
property - the value and location information of the property.
Throws:
de.smartics.util.lang.NullArgumentException - if descriptor or property is null.
IllegalArgumentException - if the descriptor and property do not match. They do not match if their property keys differ.
DuplicatePropertyDefinitionException - if the same property descriptor is attempted to be registered twice. The clashing descriptors have the same property key.

isEmpty

public boolean isEmpty()
Checks if the index contains at least one property.

Returns:
true if there is no property, false otherwise.

get

@CheckForNull
public PropertyDefinition get(@NotNull
                                           String propertyName)
                       throws de.smartics.util.lang.NullArgumentException
Returns the property definition for the given property name.

Parameters:
propertyName - the name of the property to find its definition in this index.
Returns:
the definition from the index or null if it does not exist.
Throws:
de.smartics.util.lang.NullArgumentException - if propertyName is null.

toString

public String toString()
Returns the string representation of the object.

Overrides:
toString in class Object
Returns:
the string representation of the object.


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