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 of
Angle.
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableAngle.Builderbuilder()Creates a builder forImmutableAngle.static ImmutableAngleCreates an immutable copy of aAnglevalue.inthashCode()Computes a hash code from attributes:radians.static ImmutableAngleof(double radians) Construct a new immutableAngleinstance.doubleradians()final 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 Details
-
radians
public double radians() -
withRadians
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
Construct a new immutableAngleinstance.- Parameters:
radians- The value for theradiansattribute- Returns:
- An immutable Angle instance
-
copyOf
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
Creates a builder forImmutableAngle.ImmutableAngle.builder() .radians(double) // requiredradians.build();- Returns:
- A new ImmutableAngle builder
-