Package ai.libs.jaicore.components.model
Class ComponentInstance
- java.lang.Object
-
- ai.libs.jaicore.components.model.ComponentInstance
-
- All Implemented Interfaces:
ai.libs.jaicore.basic.IAnnotatable,IComponentInstance,java.io.Serializable
public class ComponentInstance extends java.lang.Object implements IComponentInstance, java.io.Serializable
For a givenComponent, aComponent Instancedefines all parameter values and the required interfaces (recursively) and thus provides a grounding of the respectiveComponent.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ComponentInstance(IComponent component, java.util.Map<java.lang.String,java.lang.String> parameterValues, java.util.Map<java.lang.String,java.util.List<IComponentInstance>> satisfactionOfRequiredInterfaces)Constructor for creating aComponentInstancefor a particularComponent.ComponentInstance(ComponentInstance other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendAnnotation(java.lang.String key, java.lang.String annotation)booleanequals(java.lang.Object obj)java.lang.StringgetAnnotation(java.lang.String key)IComponentgetComponent()java.lang.StringgetNestedComponentDescription()java.util.Collection<IParameter>getParametersThatHaveBeenSetExplicitly()java.util.Collection<IParameter>getParametersThatHaveNotBeenSetExplicitly()java.lang.StringgetParameterValue(IParameter param)java.lang.StringgetParameterValue(java.lang.String paramName)java.util.Map<java.lang.String,java.lang.String>getParameterValues()java.lang.StringgetPrettyPrint()Returns the description of aComponentInstanceas a pretty print with indentation.java.util.List<IComponentInstance>getSatisfactionOfRequiredInterface(java.lang.String idOfRequiredInterface)java.util.Map<java.lang.String,java.util.List<IComponentInstance>>getSatisfactionOfRequiredInterfaces()inthashCode()voidputAnnotation(java.lang.String key, java.lang.String annotation)java.lang.StringtoComponentNameString()java.lang.StringtoString()
-
-
-
Constructor Detail
-
ComponentInstance
public ComponentInstance(ComponentInstance other)
-
ComponentInstance
public ComponentInstance(IComponent component, java.util.Map<java.lang.String,java.lang.String> parameterValues, java.util.Map<java.lang.String,java.util.List<IComponentInstance>> satisfactionOfRequiredInterfaces)
Constructor for creating aComponentInstancefor a particularComponent.- Parameters:
component- The component that is grounded.parameterValues- A map containing the parameter values of this grounding.satisfactionOfRequiredInterfaces- The refinement of the required interfaces.
-
-
Method Detail
-
getComponent
public IComponent getComponent()
- Specified by:
getComponentin interfaceIComponentInstance- Returns:
- The
Componentto thisComponentInstance.
-
getParameterValues
public java.util.Map<java.lang.String,java.lang.String> getParameterValues()
- Specified by:
getParameterValuesin interfaceIComponentInstance- Returns:
- The parameters and how their values were set.
-
getParametersThatHaveBeenSetExplicitly
public java.util.Collection<IParameter> getParametersThatHaveBeenSetExplicitly()
- Specified by:
getParametersThatHaveBeenSetExplicitlyin interfaceIComponentInstance- Returns:
- The set of parameters of which the values have been set explicitly.
-
getParametersThatHaveNotBeenSetExplicitly
public java.util.Collection<IParameter> getParametersThatHaveNotBeenSetExplicitly()
- Specified by:
getParametersThatHaveNotBeenSetExplicitlyin interfaceIComponentInstance- Returns:
- The set of parameters of which the values have not been set explicitly.
-
getParameterValue
public java.lang.String getParameterValue(IParameter param)
- Specified by:
getParameterValuein interfaceIComponentInstance- Parameters:
param- The parameter for which the value shall be returned.- Returns:
- The value of the parameter.
-
getParameterValue
public java.lang.String getParameterValue(java.lang.String paramName)
- Specified by:
getParameterValuein interfaceIComponentInstance- Parameters:
paramName- The name of the parameter for which the value is requested.- Returns:
- The value of the parameter with the given name.
-
getSatisfactionOfRequiredInterfaces
public java.util.Map<java.lang.String,java.util.List<IComponentInstance>> getSatisfactionOfRequiredInterfaces()
- Specified by:
getSatisfactionOfRequiredInterfacesin interfaceIComponentInstance- Returns:
- This method returns a mapping of interface IDs to component instances.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toComponentNameString
public java.lang.String toComponentNameString()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getPrettyPrint
public java.lang.String getPrettyPrint() throws java.io.IOExceptionReturns the description of aComponentInstanceas a pretty print with indentation.- Returns:
- A string representing this object in JSON format.
- Throws:
java.io.IOException- An IOException is thrown if the object cannot be serialized to a String.
-
getNestedComponentDescription
public java.lang.String getNestedComponentDescription()
-
putAnnotation
public void putAnnotation(java.lang.String key, java.lang.String annotation)- Specified by:
putAnnotationin interfaceai.libs.jaicore.basic.IAnnotatable
-
getAnnotation
public java.lang.String getAnnotation(java.lang.String key)
- Specified by:
getAnnotationin interfaceai.libs.jaicore.basic.IAnnotatable
-
appendAnnotation
public void appendAnnotation(java.lang.String key, java.lang.String annotation)- Specified by:
appendAnnotationin interfaceai.libs.jaicore.basic.IAnnotatable
-
getSatisfactionOfRequiredInterface
public java.util.List<IComponentInstance> getSatisfactionOfRequiredInterface(java.lang.String idOfRequiredInterface)
- Specified by:
getSatisfactionOfRequiredInterfacein interfaceIComponentInstance
-
-