Package pl.poznan.put.circular
Class ImmutableAngle
- java.lang.Object
-
- pl.poznan.put.circular.Angle
-
- pl.poznan.put.circular.ImmutableAngle
-
- All Implemented Interfaces:
Comparable<Angle>
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableAngle extends Angle
Immutable implementation ofAngle.Use the builder to create immutable instances:
ImmutableAngle.builder(). Use the static factory method to create immutable instances:ImmutableAngle.of().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableAngle.BuilderBuilds instances of typeImmutableAngle.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableAngle.Builderbuilder()Creates a builder forImmutableAngle.static ImmutableAnglecopyOf(Angle instance)Creates an immutable copy of aAnglevalue.inthashCode()Computes a hash code from attributes:radians.static ImmutableAngleof(double radians)Construct a new immutableAngleinstance.doubleradians()ImmutableAnglewithRadians(double value)Copy the current immutable object by setting a value for theradiansattribute.-
Methods inherited from class pl.poznan.put.circular.Angle
betweenPoints, compareTo, degrees, degrees360, distance, equals, fromHourMinuteString, isBetween, isValid, multiply, normalize, orderedSubtract, radians2PI, subtract, subtractAsVectors, subtractByAbsolutes, subtractByMinimum, torsionAngle, torsionAngle, torsionAngleByAcos, toString
-
-
-
-
Method Detail
-
radians
public double radians()
-
withRadians
public final ImmutableAngle withRadians(double value)
Copy the current immutable object by setting a value for theradiansattribute. A value strict bits equality used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for radians- Returns:
- A modified copy of the
thisobject
-
hashCode
public int hashCode()
Computes a hash code from attributes:radians.
-
of
public static ImmutableAngle of(double radians)
Construct a new immutableAngleinstance.- Parameters:
radians- The value for theradiansattribute- Returns:
- An immutable Angle instance
-
copyOf
public static ImmutableAngle copyOf(Angle instance)
Creates an immutable copy of aAnglevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Angle instance
-
builder
public static ImmutableAngle.Builder builder()
Creates a builder forImmutableAngle.ImmutableAngle.builder() .radians(double) // requiredradians.build();- Returns:
- A new ImmutableAngle builder
-
-