Class CSSRect

java.lang.Object
com.helger.css.decl.CSSRect
All Implemented Interfaces:
ICSSWriteable

@NotThreadSafe public class CSSRect extends Object implements ICSSWriteable
Represents a single CSS rectangle
Author:
Philip Helger
  • Constructor Details

    • CSSRect

      public CSSRect(@Nonnull CSSRect aOther)
      Copy constructor
      Parameters:
      aOther - The object to copy the data from. May not be null.
    • CSSRect

      public CSSRect(@Nonnull @Nonempty String sTop, @Nonnull @Nonempty String sRight, @Nonnull @Nonempty String sBottom, @Nonnull @Nonempty String sLeft)
      Constructor
      Parameters:
      sTop - Top coordinate. May neither be null nor empty.
      sRight - Tight coordinate. May neither be null nor empty.
      sBottom - Bottom coordinate. May neither be null nor empty.
      sLeft - Left coordinate. May neither be null nor empty.
  • Method Details

    • getTop

      @Nonnull @Nonempty public final String getTop()
      Returns:
      top part. Neither null nor empty.
    • setTop

      @Nonnull public final CSSRect setTop(@Nonnull @Nonempty String sTop)
      Set the top coordinate.
      Parameters:
      sTop - May neither be null nor empty.
      Returns:
      this
    • getRight

      @Nonnull @Nonempty public final String getRight()
      Returns:
      right part. Neither null nor empty.
    • setRight

      @Nonnull public final CSSRect setRight(@Nonnull @Nonempty String sRight)
      Set the right coordinate.
      Parameters:
      sRight - May neither be null nor empty.
      Returns:
      this
    • getBottom

      @Nonnull @Nonempty public final String getBottom()
      Returns:
      bottom part. Neither null nor empty.
    • setBottom

      @Nonnull public final CSSRect setBottom(@Nonnull @Nonempty String sBottom)
      Set the bottom coordinate.
      Parameters:
      sBottom - May neither be null nor empty.
      Returns:
      this
    • getLeft

      @Nonnull @Nonempty public final String getLeft()
      Returns:
      left part. Neither null nor empty.
    • setLeft

      @Nonnull public final CSSRect setLeft(@Nonnull @Nonempty String sLeft)
      Set the left coordinate.
      Parameters:
      sLeft - May neither be null nor empty.
      Returns:
      this
    • getAsCSSString

      @Nonnull @Nonempty public String getAsCSSString(@Nonnull ICSSWriterSettings aSettings, @Nonnegative int nIndentLevel)
      Description copied from interface: ICSSWriteable
      Get the contents of this object as a serialized CSS string for writing to an output.
      Specified by:
      getAsCSSString in interface ICSSWriteable
      Parameters:
      aSettings - The settings to be used to format the output. May not be null.
      nIndentLevel - The current indentation level
      Returns:
      The content of this object as CSS string. Never null.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object