Package io.didomi.sdk
Class Purpose
- java.lang.Object
-
- io.didomi.sdk.Purpose
-
- All Implemented Interfaces:
android.os.Parcelable,io.didomi.sdk.models.DataProcessing
public class Purpose extends java.lang.Object implements io.didomi.sdk.models.DataProcessingModel class for purposes
-
-
Constructor Summary
Constructors Constructor Description Purpose(android.os.Parcel in)Purpose(java.lang.String id, java.lang.String iabId, java.lang.String name, java.lang.String description)Purpose(java.lang.String id, java.lang.String iabId, java.lang.String name, java.lang.String description, boolean custom)Purpose(java.lang.String id, java.lang.String iabId, java.lang.String name, java.lang.String description, java.lang.String descriptionLegal)Purpose(java.lang.String id, java.lang.String iabId, java.lang.String name, java.lang.String description, java.lang.String descriptionLegal, boolean custom)Purpose(java.lang.String id, java.lang.String iabId, java.lang.String name, java.lang.String description, java.lang.String descriptionLegal, boolean custom, boolean isSpecialFeature)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description intdescribeContents()booleanequals(java.lang.Object obj)io.didomi.sdk.purpose.common.model.PurposeCategorygetCategory()Getter method for category.java.lang.StringgetDescription()Purpose descriptionjava.lang.StringgetDescriptionLegal()java.lang.StringgetIabId()Purpose IAB idjava.lang.StringgetId()Purpose idstatic java.util.Set<java.lang.String>getIds(java.util.Collection<Purpose> purposes)Get IDs from a list of purposesjava.lang.StringgetName()Purpose namejava.lang.StringgetTranslationKeyForName()java.lang.StringgetTranslationKeyPrefix()inthashCode()booleanisConsent()Whether the purpose is used as a consent based data processingbooleanisCustom()Deprecated.booleanisEssential()Whether this is an essential purposebooleanisLegitimateInterest()Whether the purpose is used as a legitimate interest based data processingbooleanisSpecialFeature()Whether this is a special feature displayed as a purposevoidsetCategory(io.didomi.sdk.purpose.common.model.PurposeCategory category)Update purpose category.voidsetConsent(boolean consent)voidsetDescription(java.lang.String description)Update purpose descriptionvoidsetEssential(boolean essential)voidsetId(java.lang.String id)voidsetLegitimateInterest(boolean legitimateInterest)voidsetName(java.lang.String name)Update purpose namevoidwriteToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
CREATOR
public static final android.os.Parcelable.Creator<Purpose> CREATOR
-
-
Constructor Detail
-
Purpose
public Purpose(java.lang.String id, java.lang.String iabId, java.lang.String name, java.lang.String description)
-
Purpose
public Purpose(java.lang.String id, java.lang.String iabId, java.lang.String name, java.lang.String description, java.lang.String descriptionLegal)
-
Purpose
public Purpose(java.lang.String id, java.lang.String iabId, java.lang.String name, java.lang.String description, boolean custom)
-
Purpose
public Purpose(java.lang.String id, java.lang.String iabId, java.lang.String name, java.lang.String description, java.lang.String descriptionLegal, boolean custom)
-
Purpose
public Purpose(java.lang.String id, @Nullable java.lang.String iabId, java.lang.String name, java.lang.String description, java.lang.String descriptionLegal, boolean custom, boolean isSpecialFeature)
-
Purpose
public Purpose(@NonNull android.os.Parcel in)
-
-
Method Detail
-
getIds
public static java.util.Set<java.lang.String> getIds(java.util.Collection<Purpose> purposes)
Get IDs from a list of purposes- Parameters:
purposes-- Returns:
- the list of ids of the specified purposes
-
getTranslationKeyPrefix
@NonNull public java.lang.String getTranslationKeyPrefix()
- Specified by:
getTranslationKeyPrefixin interfaceio.didomi.sdk.models.DataProcessing
-
getTranslationKeyForName
public java.lang.String getTranslationKeyForName()
-
getId
public java.lang.String getId()
Purpose id- Specified by:
getIdin interfaceio.didomi.sdk.models.DataProcessing- Returns:
- id of the purpose used internally by Didomi
-
setId
public void setId(java.lang.String id)
-
getIabId
@Nullable public java.lang.String getIabId()
Purpose IAB id- Specified by:
getIabIdin interfaceio.didomi.sdk.models.DataProcessing- Returns:
- id of the purpose as defined by IAB
-
getName
@NonNull public java.lang.String getName()
Purpose name- Specified by:
getNamein interfaceio.didomi.sdk.models.DataProcessing- Returns:
- a human-readable purpose name or translation key
-
getDescription
@NonNull public java.lang.String getDescription()
Purpose description- Specified by:
getDescriptionin interfaceio.didomi.sdk.models.DataProcessing- Returns:
- description of the purpose
-
getDescriptionLegal
@Nullable public java.lang.String getDescriptionLegal()
- Specified by:
getDescriptionLegalin interfaceio.didomi.sdk.models.DataProcessing
-
isCustom
@Deprecated public boolean isCustom()
Deprecated.
-
isEssential
public boolean isEssential()
Whether this is an essential purpose- Returns:
- true if the purpose is essential
-
isSpecialFeature
public boolean isSpecialFeature()
Whether this is a special feature displayed as a purpose- Returns:
- true if this is a special feature
-
setEssential
public void setEssential(boolean essential)
-
isLegitimateInterest
public boolean isLegitimateInterest()
Whether the purpose is used as a legitimate interest based data processing- Returns:
- true if is not essential and at least one required vendor requires this purpose for legitimate interest based data processing
-
setLegitimateInterest
public void setLegitimateInterest(boolean legitimateInterest)
-
isConsent
public boolean isConsent()
Whether the purpose is used as a consent based data processing- Returns:
- true if is not essential and at least one required vendor requires this purpose for consent based data processing
-
setConsent
public void setConsent(boolean consent)
-
getCategory
public io.didomi.sdk.purpose.common.model.PurposeCategory getCategory()
Getter method for category.- Returns:
- the purpose category
-
setCategory
public void setCategory(io.didomi.sdk.purpose.common.model.PurposeCategory category)
Update purpose category.- Parameters:
category- new category
-
setName
public void setName(java.lang.String name)
Update purpose name- Parameters:
name- new name
-
setDescription
public void setDescription(java.lang.String description)
Update purpose description- Parameters:
description- new description
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
describeContents
public int describeContents()
- Specified by:
describeContentsin interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel dest, int flags)- Specified by:
writeToParcelin interfaceandroid.os.Parcelable
-
-