Class ComponentDescriptor<T>
- java.lang.Object
-
- io.streamthoughts.azkarra.api.components.ComponentDescriptor<T>
-
- Type Parameters:
T
- the component-type.
- All Implemented Interfaces:
Comparable<ComponentDescriptor<T>>
- Direct Known Subclasses:
TopologyDescriptor
public class ComponentDescriptor<T> extends Object implements Comparable<ComponentDescriptor<T>>
TheComponentDescriptor
is the base class used fro describing components.
-
-
Constructor Summary
Constructors Constructor Description ComponentDescriptor(Class<T> type)
Creates a newComponentDescriptor
instance.ComponentDescriptor(Class<T> type, String version)
Creates a newComponentDescriptor
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAliases(Set<String> aliases)
Adds new aliases to reference the described component.Set<String>
aliases()
Gets the set of aliases for this component.String
className()
Gets the name of the describe component.int
compareTo(ComponentDescriptor<T> that)
boolean
isCloseable()
Checks whether the describe component implementCloseable
.boolean
isVersioned()
Checks whether the described component has a valid versioned.Class<T>
type()
Gets the type of the described component.String
version()
Gets the version of the described component.
-
-
-
Constructor Detail
-
ComponentDescriptor
public ComponentDescriptor(Class<T> type)
Creates a newComponentDescriptor
instance.- Parameters:
type
- the component class.
-
ComponentDescriptor
public ComponentDescriptor(Class<T> type, String version)
Creates a newComponentDescriptor
instance.- Parameters:
type
- the component class (cannot benull
).version
- the component version (may benull
).
-
-
Method Detail
-
addAliases
public void addAliases(Set<String> aliases)
Adds new aliases to reference the described component.- Parameters:
aliases
- the aliases to be added.
-
aliases
public Set<String> aliases()
Gets the set of aliases for this component.- Returns:
- the aliases.
-
className
public String className()
Gets the name of the describe component.- Returns:
- the name.
-
version
public String version()
Gets the version of the described component.- Returns:
- the component version if versioned, otherwise
UNKNOWN_VERSION
.
-
isVersioned
public boolean isVersioned()
Checks whether the described component has a valid versioned.- Returns:
true
if versioned, otherwisefalse
.
-
isCloseable
public boolean isCloseable()
Checks whether the describe component implementCloseable
.- Returns:
true
if closeable, otherwisefalse
.
-
compareTo
public int compareTo(ComponentDescriptor<T> that)
- Specified by:
compareTo
in interfaceComparable<T>
-
-