Package com.solibri.smc.api.info
Interface Information<T>
-
- Type Parameters:
T
- the type of the return value
public interface Information<T>
Implement this interface to have your own custom information takeoff (ITO) algorithm.- Since:
- 9.10.6
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Optional<T>
getInformation(Component component)
Calculates the information for given component.default String
getInformationAsString(Component component)
Show the information as aString
.default String
getName()
The internationalized name of the ITO.default PropertyType
getType()
Returns the output type of this piece of information.String
getUniqueId()
The unique ID of the ITO.
-
-
-
Method Detail
-
getUniqueId
String getUniqueId()
The unique ID of the ITO.- Returns:
- the ID of the ITO
- Since:
- 9.10.6
-
getName
default String getName()
The internationalized name of the ITO. The default implementation returns value based on properties files value with key "NAME". Returns the ID of the ITO if no property is found.- Returns:
- the name of the view
- Since:
- 9.10.6
-
getInformation
Optional<T> getInformation(Component component)
Calculates the information for given component. The implementation is allowed to cache values, but it also needs to be thread-safe.- Parameters:
component
- the component- Returns:
- the information
-
getInformationAsString
default String getInformationAsString(Component component)
Show the information as aString
. The default implementation just calls String.valueOf with the return value ofgetInformation(com.solibri.smc.api.model.Component)
as the parameter. You can implement translations in this method if needed.- Parameters:
component
- the component- Returns:
- the information as a string
-
getType
default PropertyType getType()
Returns the output type of this piece of information. The default implementation returnsPropertyType.STRING
and the developer needs to override this method if they for example want to return numeric values. For example for area calculations this would returnPropertyType.AREA
.- Returns:
- the type
-
-