Class SizeConstraint
- java.lang.Object
-
- com.yandex.mobile.ads.nativeads.template.SizeConstraint
-
- All Implemented Interfaces:
android.os.Parcelable
public final class SizeConstraint extends java.lang.Object implements android.os.Parcelable
SizeConstraint defines the way size is calculated based on banner size.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SizeConstraint.SizeConstraintType
Constraint type.
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<SizeConstraint>
CREATOR
-
Constructor Summary
Constructors Constructor Description SizeConstraint(SizeConstraint.SizeConstraintType sizeConstraintType, float value)
Constructs a newSizeConstraint
configured with size type and value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
describeContents()
boolean
equals(java.lang.Object o)
SizeConstraint.SizeConstraintType
getSizeConstraintType()
Returns size constraint type.float
getValue()
Returns value of the SizeConstraint.int
hashCode()
void
writeToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
CREATOR
public static final android.os.Parcelable.Creator<SizeConstraint> CREATOR
-
-
Constructor Detail
-
SizeConstraint
public SizeConstraint(@NonNull SizeConstraint.SizeConstraintType sizeConstraintType, float value)
Constructs a newSizeConstraint
configured with size type and value.- Parameters:
sizeConstraintType
- Constraint size type.value
- Constraint value. Value meaning differs depending on size type. Fixed value in points for SizeConstraintType.FIXED, e.g. 140. Ratio value for SizeConstraintType.FIXED_RATIO between 0 and 1, e.g. 0.5 value means size of 100 points for 200 banner size. Ratio value for SizeConstraintType.PREFERRED_RATIO between 0 and 1.- See Also:
SizeConstraint.SizeConstraintType
-
-
Method Detail
-
getValue
public float getValue()
Returns value of the SizeConstraint.- Returns:
- SizeConstraint value.
-
getSizeConstraintType
@NonNull public SizeConstraint.SizeConstraintType getSizeConstraintType()
Returns size constraint type.- Returns:
- Constraint type.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
-