Package ddf.catalog.data
Interface AttributeRegistry
public interface AttributeRegistry
Manages registered attribute types.
This code is experimental. While this interface is functional and tested, it may change or be removed in a future version of the library.
-
Method Summary
Modifier and TypeMethodDescriptionvoidderegister(AttributeDescriptor attributeDescriptor) Removes an attribute from the registry.Gets theAttributeDescriptorfor the attribute with the given name.voidregister(AttributeDescriptor attributeDescriptor) Registers a new attribute.
-
Method Details
-
register
Registers a new attribute.- Parameters:
attributeDescriptor- theAttributeDescriptordescribing the attribute- Throws:
IllegalArgumentException- ifattributeDescriptororAttributeDescriptor.getName()is null
-
deregister
Removes an attribute from the registry.Does nothing if the attributeDescriptor does not exist in the registry.
- Parameters:
attributeDescriptor- an attributeDescriptor for the attribute- Throws:
IllegalArgumentException- ifattributeDescriptoris null
-
lookup
Gets theAttributeDescriptorfor the attribute with the given name.Returns an empty
Optionalif no attribute by the namenameexists in the registry.- Parameters:
name- the name of the attribute- Returns:
- an
Optionalcontaining the registeredAttributeDescriptor - Throws:
IllegalArgumentException- ifnameis null
-