Class Range.Builder

  • Enclosing class:
    Range

    public static final class Range.Builder
    extends Object
    Facilitates the construction of Range instances. It allows for the step-by-step creation of these objects by providing methods for setting individual attributes. Input validations are performed at each build step.
    Since:
    1.12.0
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • startByte

        public Range.Builder startByte​(int value)
        Sets the start byte offset for this range.
        Parameters:
        value - byte value offset
        Returns:
        this builder
        Throws:
        IllegalArgumentException - if the value is negative
      • endByte

        public Range.Builder endByte​(int value)
        Sets the end byte offset for this range.
        Parameters:
        value - byte value offset
        Returns:
        this builder
        Throws:
        IllegalArgumentException - if the value is negative
      • build

        public Range build()
        Builds a new range instance with the attributes specified in this builder.
        Returns:
        a new range instance
        Throws:
        IllegalArgumentException - if the start byte is greater than the end byte, or if the start point is greater than the end point
        See Also:
        Point.compareTo(Point)