Record Class LegacyAggregateAdapter
java.lang.Object
java.lang.Record
com.inductiveautomation.historian.common.model.LegacyAggregateAdapter
- Record Components:
aggregate- The legacyAggregateinstance being adapted.
- All Implemented Interfaces:
AggregationType
Adapter class for legacy aggregate types to the
AggregationType interface.
This record wraps an Aggregate instance and provides implementations for
the AggregationType interface methods. It allows legacy aggregates to be
used in contexts requiring the AggregationType interface.
-
Constructor Summary
ConstructorsConstructorDescriptionLegacyAggregateAdapter(Aggregate aggregate) Creates an instance of aLegacyAggregateAdapterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaggregaterecord component.dataType()Retrieves the data type of the aggregate.Retrieves the description of the aggregate as a localized string.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intRetrieves the identifier of the aggregate.name()Retrieves the name of the aggregate.static LegacyAggregateAdapterCreates a newLegacyAggregateAdapterfor the given legacy aggregate.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LegacyAggregateAdapter
Creates an instance of aLegacyAggregateAdapterrecord class.- Parameters:
aggregate- the value for theaggregaterecord component
-
-
Method Details
-
of
Creates a newLegacyAggregateAdapterfor the given legacy aggregate.- Parameters:
legacy- The legacyAggregateinstance to adapt.- Returns:
- A new
LegacyAggregateAdapterinstance.
-
identifier
public int identifier()Retrieves the identifier of the aggregate.- Specified by:
identifierin interfaceAggregationType- Returns:
- The unique identifier of the aggregate.
-
name
Retrieves the name of the aggregate.- Specified by:
namein interfaceAggregationType- Returns:
- The name of the aggregate.
-
description
Retrieves the description of the aggregate as a localized string.- Specified by:
descriptionin interfaceAggregationType- Returns:
- A
LocalizedStringrepresenting the description of the aggregate.
-
dataType
Retrieves the data type of the aggregate.This implementation always returns an empty
Optional, as the data type is not applicable for legacy aggregates.- Specified by:
dataTypein interfaceAggregationType- Returns:
- An empty
Optionalindicating no data type is available.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
aggregate
Returns the value of theaggregaterecord component.- Returns:
- the value of the
aggregaterecord component
-