Interface Cloneable<O extends Cloneable<O>>

Type Parameters:
O - Type of the cloneable object
All Known Implementing Classes:
AssetPoolEvent, AudioSource, Circle, Color, Colour, ConfigOptionEvent, CubicBezierEasing, Dimension, Dimension.Add, Dimension.Clamp, Dimension.If, Dimension.Max, Dimension.Min, Dimension.Mix, Dimension.Multiply, Dimension.Subtract, DimensionBase, DimensionComparator, Directory, DualDimension, Event, FixedColorProperty, FixedObjectProperty, FixedStringProperty, Image, NodeEvent, QuadDimension, Rect, RoundedRect, Shape, StepEasing, Texture, TextureArray, TextureArrayLayer, Vector, Vector2f, Vector2i, Vector3f, Vector3i, Vector4f, Vector4i, VectorFloat, VectorInt

public interface Cloneable<O extends Cloneable<O>>
Abstract interface for cloneable objects. A cloneable object should have a clone() method that returns a new instance and an equals(object) method that returns true when used with the clone.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a new object that is equal to this object.
    static <C extends Cloneable<C>>
    C
    cloneOf(C cloneable)
    Clones the cloneable, if it is not null.
    boolean
    equals(O other)
    Checks if the given object is equal to this object.
  • Method Details

    • equals

      @Contract("null -> false") boolean equals(O other)
      Checks if the given object is equal to this object.
      Parameters:
      other - Other object
      Returns:
      true if both objects are equal.
    • clone

      @Contract("-> new") O clone()
      Returns a new object that is equal to this object.
      Returns:
      Clone of this object
    • cloneOf

      @Contract("null -> null; !null -> new") static <C extends Cloneable<C>> C cloneOf(C cloneable)
      Clones the cloneable, if it is not null.
      Type Parameters:
      C - The type of cloneable
      Parameters:
      cloneable - The cloneable, or null
      Returns:
      The clone, or null