Interface SelfDescribingScalarData

All Known Subinterfaces:
LookupTable, Relation, TypedCoverage
All Known Implementing Classes:
EmptyRelation, TypedCoverage.Empty

public interface SelfDescribingScalarData

An optional interface for an object that can describe itself in terms of RiskScape types. This allows an arbitrary instance of SelfDescribingScalarData to be injected in to a pipeline or an expression with correct type information.

  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the RiskScape type that describes this data when extracted from a project and added in to a pipeline as a scalar value.
    static Optional<Type>
    Handy method that will attempt top return you a riskscape type for an object, first checking if it's self describing, then falling back to Types.fromJavaType(Class)
  • Method Details

    • getScalarDataType

      static Optional<Type> getScalarDataType(Object instance)

      Handy method that will attempt top return you a riskscape type for an object, first checking if it's self describing, then falling back to Types.fromJavaType(Class)

    • getScalarDataType

      Type getScalarDataType()

      Returns the RiskScape type that describes this data when extracted from a project and added in to a pipeline as a scalar value.

      It is referred to as the scalar type to make it clear it's not the same as the Type of the data contained within it, e.g. the Struct type of the relation (non-scalar) vs RelationType that represents the relation itself (scalar).