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.Builder
builder()
Creates a builder forImmutableAngle
.static ImmutableAngle
Creates an immutable copy of aAngle
value.int
hashCode()
Computes a hash code from attributes:radians
.static ImmutableAngle
of
(double radians) Construct a new immutableAngle
instance.double
radians()
final ImmutableAngle
withRadians
(double value) Copy the current immutable object by setting a value for theradians
attribute.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 theradians
attribute. 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
this
object
-
hashCode
public int hashCode()Computes a hash code from attributes:radians
. -
of
Construct a new immutableAngle
instance.- Parameters:
radians
- The value for theradians
attribute- Returns:
- An immutable Angle instance
-
copyOf
Creates an immutable copy of aAngle
value. 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) // required
radians
.build();- Returns:
- A new ImmutableAngle builder
-