Class VolumeValue
java.lang.Object
org.tquadrat.foundation.value.api.ValueBase<Volume, VolumeValue>
org.tquadrat.foundation.value.VolumeValue
- All Implemented Interfaces:
Serializable, Cloneable, Comparable<DimensionedValue<Volume>>, Formattable, DimensionedValue<Volume>
@ClassVersion(sourceVersion="$Id: VolumeValue.java 1151 2025-10-01 21:32:15Z tquadrat $")
@API(status=STABLE,
since="0.1.0")
public final class VolumeValue
extends ValueBase<Volume, VolumeValue>
A value class for volumes.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: VolumeValue.java 1151 2025-10-01 21:32:15Z tquadrat $
- Since:
- 0.1.0
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.value.VolumeValue"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final BiPredicate<Volume, BigDecimal> The validator for volumes.Fields inherited from class ValueBase
DEFAULT_VALIDATORFields inherited from interface DimensionedValue
MATH_CONTEXT -
Constructor Summary
ConstructorsModifierConstructorDescriptionVolumeValue(Volume dimension, String value) Creates a newVolumeValueinstance.VolumeValue(Volume dimension, BigDecimal value) Creates a newVolumeValueinstance.<N extends Number>VolumeValue(Volume dimension, N value) Creates a newVolumeValueinstance.VolumeValue(Volume dimension, AreaValue area, LengthValue height) Creates a newVolumeValueinstance.VolumeValue(Volume dimension, LengthValue length, LengthValue width, LengthValue height) Creates a newVolumeValueinstance. -
Method Summary
-
Field Details
-
VOLUME_VALIDATOR
The validator for volumes.
A volume may not be less than 0.
-
-
Constructor Details
-
VolumeValue
Creates a newVolumeValueinstance.- Parameters:
dimension- The dimension.value- The value.
-
VolumeValue
Creates a newVolumeValueinstance.- Parameters:
dimension- The dimension.value- The value; it must be possible to parse the given String into aBigDecimal.- Throws:
NumberFormatException- The provided value cannot be converted into aBigDecimal.
-
VolumeValue
Creates a newVolumeValueinstance.- Type Parameters:
N- The type ofvalue.- Parameters:
dimension- The dimension.value- The value.
-
VolumeValue
Creates a new
VolumeValueinstance.A volume can be determined by multiplication of length, width and height.
- Parameters:
dimension- The dimension.length- The length.width- The width.height- The height.
-
VolumeValue
Creates a new
VolumeValueinstance.A volume can be determined by multiplication of ground area and height.
- Parameters:
dimension- The dimension.area- The ground area.height- The height.
-
-
Method Details
-
clone
Creates a new copy of this value.- Specified by:
clonein interfaceDimensionedValue<Volume>- Overrides:
clonein classValueBase<Volume, VolumeValue>- Returns:
- The copy.
-
