Enum Class Rotation

java.lang.Object
java.lang.Enum<Rotation>
org.sejda.model.rotation.Rotation
All Implemented Interfaces:
Serializable, Comparable<Rotation>, Constable, FriendlyNamed

public enum Rotation extends Enum<Rotation> implements FriendlyNamed
Enum to model a page rotation.
Author:
Andrea Vacondio
  • Enum Constant Details

    • DEGREES_0

      public static final Rotation DEGREES_0
    • DEGREES_90

      public static final Rotation DEGREES_90
    • DEGREES_180

      public static final Rotation DEGREES_180
    • DEGREES_270

      public static final Rotation DEGREES_270
  • Method Details

    • values

      public static Rotation[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Rotation valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getFriendlyName

      public String getFriendlyName()
      Specified by:
      getFriendlyName in interface FriendlyNamed
      Returns:
      the friendly name of the entity, to be usually used as a representation for an user.
    • getDegrees

      public int getDegrees()
      Returns:
      the degrees
    • getRotation

      public static Rotation getRotation(int degrees)
      Parameters:
      degrees - rotation degrees
      Returns:
      the rotation corresponding to the input degrees module 360. Only multiple of 90 degrees are recognized as valid rotations otherwise a zero degrees rotation is returned.
    • addRotation

      public Rotation addRotation(Rotation rotation)
      Parameters:
      rotation -
      Returns:
      the rotation obtained adding the input rotation to the current rotation.
    • rotateClockwise

      public Rotation rotateClockwise()
      Returns:
      a clockwise rotation
    • rotateAnticlockwise

      public Rotation rotateAnticlockwise()
      Returns:
      an anti clockwise rotation