Record Class LegacyAggregateAdapter
java.lang.Object
java.lang.Record
com.inductiveautomation.historian.common.model.LegacyAggregateAdapter
- Record Components:
aggregate
- The legacyAggregate
instance 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 aLegacyAggregateAdapter
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaggregate
record component.dataType()
Retrieves the data type of the aggregate.Retrieves the description of the aggregate as a localized string.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Retrieves the identifier of the aggregate.name()
Retrieves the name of the aggregate.static LegacyAggregateAdapter
Creates a newLegacyAggregateAdapter
for the given legacy aggregate.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
LegacyAggregateAdapter
Creates an instance of aLegacyAggregateAdapter
record class.- Parameters:
aggregate
- the value for theaggregate
record component
-
-
Method Details
-
of
Creates a newLegacyAggregateAdapter
for the given legacy aggregate.- Parameters:
legacy
- The legacyAggregate
instance to adapt.- Returns:
- A new
LegacyAggregateAdapter
instance.
-
identifier
public int identifier()Retrieves the identifier of the aggregate.- Specified by:
identifier
in interfaceAggregationType
- Returns:
- The unique identifier of the aggregate.
-
name
Retrieves the name of the aggregate.- Specified by:
name
in interfaceAggregationType
- Returns:
- The name of the aggregate.
-
description
Retrieves the description of the aggregate as a localized string.- Specified by:
description
in interfaceAggregationType
- Returns:
- A
LocalizedString
representing 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:
dataType
in interfaceAggregationType
- Returns:
- An empty
Optional
indicating 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 theaggregate
record component.- Returns:
- the value of the
aggregate
record component
-