Class EncodingDescriptor


  • public final class EncodingDescriptor
    extends java.lang.Object
    Names a message payload encoding, such as CBOR or JSON.

    Encodings are used for representing messages while in transit between systems. They can also be used for representing data that is stored to disk, databases or other media.

    • Method Detail

      • allWithDtoSupport

        public static java.util.Set<EncodingDescriptor> allWithDtoSupport()
        Gets a set of all encodings for which Kalix DTO support exists. Such encodings can be read and written automatically by the Kalix library.
        Returns:
        Set of all encodings with DTO support.
        See Also:
        se.arkalix.dto
      • get

        public static EncodingDescriptor get​(DtoEncoding dtoEncoding)
        Acquires a cached encoding descriptor matching the given DTO encoding.
        Parameters:
        dtoEncoding - DTO encoding matching desired encoding descriptor.
        Returns:
        Existing encoding descriptor.
      • getOrCreate

        public static EncodingDescriptor getOrCreate​(java.lang.String name)
        Either acquires a cached encoding descriptor matching the given name, or creates a new descriptor.
        Parameters:
        name - Desired encoding descriptor name.
        Returns:
        New or existing encoding descriptor.
      • name

        public java.lang.String name()
        Returns:
        Encoding identifier.
      • asDto

        public java.util.Optional<DtoEncoding> asDto()
        Gets DTO variant of this descriptor, if any such exists.
        Returns:
        DTO variant of this descriptor.
        See Also:
        se.arkalix.dto
      • isDto

        public boolean isDto()
        Returns:
        true only if DTO support is available for this encoding.
        See Also:
        se.arkalix.dto
      • equals

        public boolean equals​(java.lang.Object o)
        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