Class TapLimit


  • public class TapLimit
    extends java.lang.Object
    Characterises a limit which applies to a TAP service. This class can represent values encoded by the TAPRegExt DataLimits and TimeLimits element types.
    Since:
    8 Mar 2011
    Author:
    Mark Taylor
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String BYTES
      Unit string used for a data limit of bytes ("byte").
      static java.lang.String ROWS
      Unit string used for a data limit of rows ("row").
      static java.lang.String SECONDS
      Unit string used always for time limits ("seconds").
    • Constructor Summary

      Constructors 
      Constructor Description
      TapLimit​(long value, boolean isHard, java.lang.String unit)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getUnit()
      Returns the limit unit.
      long getValue()
      Returns the limit value.
      boolean isHard()
      Indicates whether this is a hard or soft (default) limit.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • SECONDS

        public static final java.lang.String SECONDS
        Unit string used always for time limits ("seconds").
        See Also:
        Constant Field Values
      • ROWS

        public static final java.lang.String ROWS
        Unit string used for a data limit of rows ("row").
        See Also:
        Constant Field Values
      • BYTES

        public static final java.lang.String BYTES
        Unit string used for a data limit of bytes ("byte").
        See Also:
        Constant Field Values
    • Constructor Detail

      • TapLimit

        public TapLimit​(long value,
                        boolean isHard,
                        java.lang.String unit)
        Constructor.
        Parameters:
        value - limit value
        isHard - true for a hard limit, false for a default limit
        unit - unit for value
    • Method Detail

      • getValue

        public long getValue()
        Returns the limit value.
        Returns:
        limit value
      • isHard

        public boolean isHard()
        Indicates whether this is a hard or soft (default) limit.
        Returns:
        true for hard limit, false for default limit
      • getUnit

        public java.lang.String getUnit()
        Returns the limit unit. Should be SECONDS for time limits, and either ROWS or BYTES for data limits.
        Returns:
        limit unit
      • toString

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