Record Class Packaging
java.lang.Object
java.lang.Record
com.alpermulayim.openfoodfacts_spring_boot_starter.dtos.Packaging
public record Packaging(Integer numberOfUnits, String shape, String material, String recycling, String quantityPerUnit, Double quantityPerUnitValue, String quantityPerUnitUnit, Double weightSpecified, Double weightMeasured, Double weightEstimated, Double weight, String weightSourceId)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionPackaging
(Integer numberOfUnits, String shape, String material, String recycling, String quantityPerUnit, Double quantityPerUnitValue, String quantityPerUnitUnit, Double weightSpecified, Double weightMeasured, Double weightEstimated, Double weight, String weightSourceId) Creates an instance of aPackaging
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.material()
Returns the value of thematerial
record component.Returns the value of thenumberOfUnits
record component.Returns the value of thequantityPerUnit
record component.Returns the value of thequantityPerUnitUnit
record component.Returns the value of thequantityPerUnitValue
record component.Returns the value of therecycling
record component.shape()
Returns the value of theshape
record component.final String
toString()
Returns a string representation of this record class.weight()
Returns the value of theweight
record component.Returns the value of theweightEstimated
record component.Returns the value of theweightMeasured
record component.Returns the value of theweightSourceId
record component.Returns the value of theweightSpecified
record component.
-
Constructor Details
-
Packaging
public Packaging(Integer numberOfUnits, String shape, String material, String recycling, String quantityPerUnit, Double quantityPerUnitValue, String quantityPerUnitUnit, Double weightSpecified, Double weightMeasured, Double weightEstimated, Double weight, String weightSourceId) Creates an instance of aPackaging
record class.- Parameters:
numberOfUnits
- the value for thenumberOfUnits
record componentshape
- the value for theshape
record componentmaterial
- the value for thematerial
record componentrecycling
- the value for therecycling
record componentquantityPerUnit
- the value for thequantityPerUnit
record componentquantityPerUnitValue
- the value for thequantityPerUnitValue
record componentquantityPerUnitUnit
- the value for thequantityPerUnitUnit
record componentweightSpecified
- the value for theweightSpecified
record componentweightMeasured
- the value for theweightMeasured
record componentweightEstimated
- the value for theweightEstimated
record componentweight
- the value for theweight
record componentweightSourceId
- the value for theweightSourceId
record component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
numberOfUnits
Returns the value of thenumberOfUnits
record component.- Returns:
- the value of the
numberOfUnits
record component
-
shape
Returns the value of theshape
record component.- Returns:
- the value of the
shape
record component
-
material
Returns the value of thematerial
record component.- Returns:
- the value of the
material
record component
-
recycling
Returns the value of therecycling
record component.- Returns:
- the value of the
recycling
record component
-
quantityPerUnit
Returns the value of thequantityPerUnit
record component.- Returns:
- the value of the
quantityPerUnit
record component
-
quantityPerUnitValue
Returns the value of thequantityPerUnitValue
record component.- Returns:
- the value of the
quantityPerUnitValue
record component
-
quantityPerUnitUnit
Returns the value of thequantityPerUnitUnit
record component.- Returns:
- the value of the
quantityPerUnitUnit
record component
-
weightSpecified
Returns the value of theweightSpecified
record component.- Returns:
- the value of the
weightSpecified
record component
-
weightMeasured
Returns the value of theweightMeasured
record component.- Returns:
- the value of the
weightMeasured
record component
-
weightEstimated
Returns the value of theweightEstimated
record component.- Returns:
- the value of the
weightEstimated
record component
-
weight
Returns the value of theweight
record component.- Returns:
- the value of the
weight
record component
-
weightSourceId
Returns the value of theweightSourceId
record component.- Returns:
- the value of the
weightSourceId
record component
-