Class NamespaceLifetimeBuilder

  • All Implemented Interfaces:
    Serializer

    public class NamespaceLifetimeBuilder
    extends java.lang.Object
    implements Serializer
    Binary layout for namespace lifetime
    • Constructor Detail

      • NamespaceLifetimeBuilder

        protected NamespaceLifetimeBuilder​(java.io.DataInputStream stream)
        Constructor - Creates an object from stream.
        Parameters:
        stream - Byte stream to use to serialize the object.
      • NamespaceLifetimeBuilder

        protected NamespaceLifetimeBuilder​(HeightDto lifetimeStart,
                                           HeightDto lifetimeEnd)
        Constructor.
        Parameters:
        lifetimeStart - Start height.
        lifetimeEnd - End height.
    • Method Detail

      • loadFromBinary

        public static NamespaceLifetimeBuilder loadFromBinary​(java.io.DataInputStream stream)
        Creates an instance of NamespaceLifetimeBuilder from a stream.
        Parameters:
        stream - Byte stream to use to serialize the object.
        Returns:
        Instance of NamespaceLifetimeBuilder.
      • create

        public static NamespaceLifetimeBuilder create​(HeightDto lifetimeStart,
                                                      HeightDto lifetimeEnd)
        Creates an instance of NamespaceLifetimeBuilder.
        Parameters:
        lifetimeStart - Start height.
        lifetimeEnd - End height.
        Returns:
        Instance of NamespaceLifetimeBuilder.
      • getLifetimeStart

        public HeightDto getLifetimeStart()
        Gets start height.
        Returns:
        Start height.
      • getLifetimeEnd

        public HeightDto getLifetimeEnd()
        Gets end height.
        Returns:
        End height.
      • getSize

        public int getSize()
        Gets the size of the object.
        Specified by:
        getSize in interface Serializer
        Returns:
        Size in bytes.
      • serialize

        public byte[] serialize()
        Serializes an object to bytes.
        Specified by:
        serialize in interface Serializer
        Returns:
        Serialized bytes.