Package hydra.typing

Class Result

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Result>

    public class Result
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Comparable<Result>
    The result of a term, consisting of a type and an optional human-readable description.
    See Also:
    Serialized Form
    • Field Detail

      • TYPE_

        public static final Name TYPE_
        Name of the hydra.typing.Result type.
      • DESCRIPTION

        public static final Name DESCRIPTION
        Name of the hydra.typing.Result.description field.
      • TYPE

        public static final Name TYPE
        Name of the hydra.typing.Result.type field.
      • description

        public final Optional<java.lang.String> description
        An optional human-readable description of the result
      • type

        public final Type type
        The type of the result
    • Constructor Detail

      • Result

        public Result​(Optional<java.lang.String> description,
                      Type type)
        Constructs an immutable Result.
        Parameters:
        description - An optional human-readable description of the result
        type - The type of the result
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(Result other)
        Specified by:
        compareTo in interface java.lang.Comparable<Result>
      • withDescription

        public Result withDescription​(Optional<java.lang.String> description)
        Returns a copy of this Result with description replaced.
      • withType

        public Result withType​(Type type)
        Returns a copy of this Result with type replaced.