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 TypeClass and Description
static class SizeConstraint.SizeConstraintType
Constraint type.

Nested classes/interfaces inherited from interface android.os.Parcelable

android.os.Parcelable.ClassLoaderCreator<T>, android.os.Parcelable.Creator<T>

Field Summary

Fields
Modifier and TypeField and Description
static android.os.Parcelable.Creator<SizeConstraint>CREATOR 

Fields inherited from interface android.os.Parcelable

CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE

Constructor Summary

Constructors
Constructor and Description
SizeConstraint(SizeConstraint.SizeConstraintType sizeConstraintType, float value)
Constructs a new SizeConstraint configured with size type and value.

Method Summary

All Methods
Instance Methods
Concrete Methods
Modifier and TypeMethod and Description
intdescribeContents() 
booleanequals(java.lang.Object o) 
SizeConstraint.SizeConstraintTypegetSizeConstraintType()
Returns size constraint type.
floatgetValue()
Returns value of the SizeConstraint.
inthashCode() 
voidwriteToParcel(android.os.Parcel dest, int flags) 

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, toString, wait, wait, wait

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 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 class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

describeContents

public int describeContents()
Specified by:
describeContents in interface android.os.Parcelable

writeToParcel

public void writeToParcel(android.os.Parcel dest,
                          int flags)
Specified by:
writeToParcel in interface android.os.Parcelable