com.yandex.mobile.ads.nativeads.template
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
Modifier and Type | Class and Description |
---|---|
static class | SizeConstraint.SizeConstraintType
Constraint type.
|
Field Summary
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<SizeConstraint> | CREATOR |
Constructor Summary
Constructor and Description |
---|
SizeConstraint(SizeConstraint.SizeConstraintType sizeConstraintType, float value)
Constructs a new
SizeConstraint configured with size type and value. |
Method Summary
Modifier and Type | Method and 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) |
Constructor Detail
SizeConstraint
public SizeConstraint(@NonNull SizeConstraint.SizeConstraintType sizeConstraintType, float value)
Constructs a new
SizeConstraint
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