Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
9812b66
optimize hot loops
yuzawa-san Jan 12, 2026
674d03f
clean up mutability collection flow
yuzawa-san Jan 12, 2026
cd9a876
use arrays
yuzawa-san Jan 12, 2026
bf62f5f
clean up dirty flow again
yuzawa-san Jan 12, 2026
56b930e
FixedIntegerList
yuzawa-san Jan 12, 2026
8f80001
avoid itable calls to IntegerSet
yuzawa-san Jan 12, 2026
1515377
update tests
yuzawa-san Jan 13, 2026
74870a8
fixed signed byte int limit
yuzawa-san Jan 13, 2026
92cbd01
javadoc
yuzawa-san Jan 13, 2026
5070310
DirtyableList
yuzawa-san Jan 13, 2026
06f6c28
fix test
yuzawa-san Jan 13, 2026
2b97c41
remove substring
yuzawa-san Jan 15, 2026
3ab0e44
fix tests
yuzawa-san Jan 15, 2026
35ace8d
fix copy
yuzawa-san Jan 16, 2026
ed4581a
own bitset
yuzawa-san Jan 16, 2026
ec6b366
wip
yuzawa-san Jan 16, 2026
c7cc6b6
remove imports
yuzawa-san Jan 16, 2026
22b1caa
style
yuzawa-san Jan 20, 2026
e966b1e
optimize fibonacci
yuzawa-san Jan 27, 2026
3645237
optimize encode
yuzawa-san Jan 27, 2026
b569dff
convert fields to enums
yuzawa-san Jan 21, 2026
af6ab8d
thin segments
yuzawa-san Jan 21, 2026
269e8a5
move
yuzawa-san Jan 21, 2026
61524c4
dry
yuzawa-san Jan 21, 2026
842af42
dry
yuzawa-san Jan 22, 2026
80abb08
use an abstract method
yuzawa-san Jan 22, 2026
e96873e
more dry
yuzawa-san Jan 22, 2026
bbaad3c
more dry
yuzawa-san Jan 22, 2026
900b542
clean up flows
yuzawa-san Jan 23, 2026
09ef2d9
clean up hierarchy
yuzawa-san Jan 23, 2026
b9817bb
style
yuzawa-san Jan 23, 2026
cd9bb63
remove extra class
yuzawa-san Jan 23, 2026
70c65ef
use fieldkey
yuzawa-san Jan 23, 2026
3f5f9c8
toString
yuzawa-san Jan 23, 2026
f9e14b0
user headers to store state
yuzawa-san Jan 24, 2026
7639aaf
clean up registry of sections
yuzawa-san Jan 24, 2026
a9e2109
cleanup
yuzawa-san Jan 24, 2026
14e87ae
notes
yuzawa-san Jan 24, 2026
45f0c2b
use array
yuzawa-san Jan 27, 2026
fba9fbb
cleanup
yuzawa-san Jan 27, 2026
647eb79
another size
yuzawa-san Jan 27, 2026
46843c7
fix sizing
yuzawa-san Jan 28, 2026
e50a578
fix dirty on init
yuzawa-san Jan 28, 2026
1ae9e6d
;
yuzawa-san Jan 28, 2026
4e73663
upgrade slicing methodology to use indexOf
yuzawa-san Jan 28, 2026
f463f6b
substring
yuzawa-san Jan 28, 2026
a8d48c5
clear only if something was there
yuzawa-san Jan 28, 2026
9ea3b08
do base64 in blocks
yuzawa-san Jan 28, 2026
5c1d473
add base 64 test
yuzawa-san Jan 28, 2026
e09b30e
clean up maven configuration
yuzawa-san Jan 29, 2026
7e1a12f
use bit set for fixed list
yuzawa-san Feb 2, 2026
dcd562f
lazy init of collections when decode does slices
yuzawa-san Feb 3, 2026
cc1ebac
make tests pass
yuzawa-san Feb 3, 2026
e0840d0
unify bit string
yuzawa-san Feb 3, 2026
2b17ddd
remove redundant code
yuzawa-san Feb 3, 2026
b785693
consolidate and rename read/write methods
yuzawa-san Feb 3, 2026
c835146
fix packages
yuzawa-san Feb 3, 2026
2638edb
fewer field updates
yuzawa-san Feb 3, 2026
51a08ab
flip byte order
yuzawa-san Feb 3, 2026
9ed3b17
faster numeric decoders
yuzawa-san Feb 3, 2026
adcdb9b
cleanup
yuzawa-san Feb 3, 2026
8df35e0
clean up DataType
yuzawa-san Feb 9, 2026
d3fff8a
unify datatype hierarchy
yuzawa-san Feb 9, 2026
6a11348
migrate to fields
yuzawa-san Feb 10, 2026
8d87d70
fix dynamic sizing
yuzawa-san Feb 10, 2026
10bd6a4
fix tests and cleanup
yuzawa-san Feb 10, 2026
c3fdad4
remove bespoke segments
yuzawa-san Feb 10, 2026
0a1ea09
clean up us hierarchy
yuzawa-san Feb 10, 2026
6e3bb4d
cleanup
yuzawa-san Feb 10, 2026
6be47f5
fix deriveds
yuzawa-san Feb 10, 2026
bff7d39
move name
yuzawa-san Feb 10, 2026
e10dedd
add some tostring
yuzawa-san Feb 10, 2026
c430b5f
presize gpp section map
yuzawa-san Feb 11, 2026
86c27fc
clean up exceptions
yuzawa-san Feb 11, 2026
dd962e9
more clean up
yuzawa-san Feb 11, 2026
f647e9b
test field names to string
yuzawa-san Feb 11, 2026
0a3f100
fix constant names
yuzawa-san Feb 11, 2026
558aaa2
optimize validator
yuzawa-san Feb 11, 2026
1fb8dab
move source and add jacoco
yuzawa-san Feb 11, 2026
ff3f858
use SNAPSHOT instead of RC1
yuzawa-san Feb 19, 2026
620be79
Merge branch '4.X-maven-fixes' of github.com:yuzawa-san/iabgpp-java i…
yuzawa-san Feb 19, 2026
0ff66ac
spotless apply
yuzawa-san Feb 19, 2026
2fd8542
remove useless formatter on/off
yuzawa-san Feb 19, 2026
d3aca85
lazy slicing
yuzawa-san Feb 19, 2026
db1c6a1
add mn
yuzawa-san Feb 19, 2026
7ecbbc7
seamless support usnatv2
yuzawa-san Feb 19, 2026
2f9f831
Merge branch '4.X-mn' into 4.X-perf-optimizations
yuzawa-san Feb 19, 2026
32e3a5f
clean up mn
yuzawa-san Feb 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
159 changes: 6 additions & 153 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The official iabgpp java library is distributed through maven central. Please [s

#### Decoding

```
```xml
<dependency>
<groupId>com.iabgpp</groupId>
<artifactId>iabgpp-encoder</artifactId>
Expand All @@ -37,15 +37,15 @@ Integer uspV1Notice = uspV1Section.getNotice();

#### Encoding

```
```xml
<dependency>
<groupId>com.iabgpp</groupId>
<artifactId>iabgpp-encoder</artifactId>
<version>VERSION</version>
</dependency>
```

```
```java
import com.iab.gpp.encoder.GppModel;
import com.iab.gpp.encoder.section.TcfEuV2;
import com.iab.gpp.encoder.section.UspV1;
Expand Down Expand Up @@ -76,7 +76,7 @@ String gppString = gppModel.encode();
The `iabgpp-extras` and `iabgpp-extras-jackson` libraries provides an interface and ability to parse the GVL and CMP
List respectively. The `iabgpp-extras-jackson` library uses Jackson 2.10.3 to parse the GVL and CMP List JSON.

```
```xml
<dependency>
<groupId>com.iabgpp</groupId>
<artifactId>iabgpp-extras</artifactId>
Expand All @@ -93,7 +93,7 @@ List respectively. The `iabgpp-extras-jackson` library uses Jackson 2.10.3 to pa

Example of parsing the GVL,

```
```java
import com.iab.gpp.extras.jackson.Loader;
import com.iab.gpp.extras.gvl.Gvl;

Expand All @@ -104,7 +104,7 @@ Gvl gvl = loader.globalVendorList(gvlContent);

Example of parsing the CMP List,

```
```java
import com.iab.gpp.extras.jackson.Loader;
import com.iab.gpp.extras.cmp.CmpList;

Expand All @@ -113,153 +113,6 @@ Loader loader = new Loader();
CmpList cmpList = loader.cmpList(cmpListContent);
```

### Fields

|Section Name|Section ID|Field|Data Type/Value|
|------------|----------|-----|---------------|
|tcfeuv2|2|Version|6 bit int. Value is 2.|
|tcfeuv2|2|Created|Datetime. Updated when fields are set|
|tcfeuv2|2|LastUpdated|Datetime. Updated when fields are set|
|tcfeuv2|2|CmpId|12 bit int|
|tcfeuv2|2|CmpVersion|12 bit int|
|tcfeuv2|2|ConsentScreen|6 bit int|
|tcfeuv2|2|ConsentLanguage|2 character country code|
|tcfeuv2|2|VendorListVersion|12 bit int|
|tcfeuv2|2|PolicyVersion|6 bit int. Value is 2|
|tcfeuv2|2|IsServiceSpecific|Boolean|
|tcfeuv2|2|UseNonStandardStacks|Boolean|
|tcfeuv2|2|SpecialFeatureOptins|Boolean list of size 12|
|tcfeuv2|2|PurposeConsents|Boolean list of size 24|
|tcfeuv2|2|PurposeLegitimateInterests|Boolean list of size 24|
|tcfeuv2|2|PurposeOneTreatment|Boolean|
|tcfeuv2|2|PublisherCountryCode|2 character country code|
|tcfeuv2|2|VendorConsents|Integer list of variable size|
|tcfeuv2|2|VendorLegitimateInterests|Integer list of variable size|
|tcfeuv2|2|PublisherRestrictions|Integer list of variable size|
|tcfeuv2|2|PublisherPurposesSegmentType|3 bit int. Value is 3|
|tcfeuv2|2|PublisherConsents|Boolean list of size 24|
|tcfeuv2|2|PublisherLegitimateInterests|Boolean list of size 24|
|tcfeuv2|2|NumCustomPurposes|6 bit int|
|tcfeuv2|2|PublisherCustomConsents|Boolean list where size is set by the NumCustomPurposes field|
|tcfeuv2|2|PublisherCustomLegitimateInterests|Boolean list where size is set by the NumCustomPurposes field|
|tcfeuv2|2|VendorsAllowedSegmentType|3 bit int. Value is 2|
|tcfeuv2|2|VendorsAllowed|Integer list of variable size|
|tcfeuv2|2|VendorsDisclosedSegmentType|3 bit int. Value is 1|
|tcfeuv2|2|VendorsDisclosed|Integer list of variable size|
|tcfcav1|5|Version|6 bit int. Value is 2.|
|tcfcav1|5|Created|Datetime. Updated when any fields are set|
|tcfcav1|5|LastUpdated|Datetime. Updated when any fields are set|
|tcfcav1|5|CmpId|12 bit int|
|tcfcav1|5|CmpVersion|12 bit int|
|tcfcav1|5|ConsentScreen|6 bit int|
|tcfcav1|5|ConsentLanguage|2 character country code|
|tcfcav1|5|VendorListVersion|12 bit int|
|tcfcav1|5|TcfPolicyVersion|6 bit int. Value is 2.|
|tcfcav1|5|UseNonStandardStacks|Boolean|
|tcfcav1|5|SpecialFeatureExpressConsent|Boolean list of size 12|
|tcfcav1|5|PurposesExpressConsent|Boolean list of size 24|
|tcfcav1|5|PurposesImpliedConsent|Boolean list of size 24|
|tcfcav1|5|VendorExpressConsent|Integer list of variable size|
|tcfcav1|5|VendorImpliedConsent|Integer list of variable size|
|tcfcav1|5|PubRestrictions|RangeEntry list of variable size|
|tcfcav1|5|PubPurposesSegmentType|3 bit int. Value is 3|
|tcfcav1|5|PubPurposesExpressConsent|Boolean list of size 24|
|tcfcav1|5|PubPurposesImpliedConsent|Boolean list of size 24|
|tcfcav1|5|NumCustomPurposes|6 bit int|
|tcfcav1|5|CustomPurposesExpressConsent|Boolean list where size is set by the NumCustomPurposes field|
|tcfcav1|5|CustomPurposesImpliedConsent|Boolean list where size is set by the NumCustomPurposes field|
|tcfcav1|5|DisclosedVendorsSegmentType|3 bit int. Value is 1|
|tcfcav1|5|DisclosedVendors|Integer list of variable size|
|uspv1|6|Version|6 bit int. Value is 1|
|uspv1|6|Notice|2 bit int|
|uspv1|6|OptOutSale|2 bit int|
|uspv1|6|LspaCovered|2 bit int|
|usnat|7|Version|6 bit int. Value is 1|
|usnat|7|SharingNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SaleOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SharingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|TargetedAdvertisingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SensitiveDataProcessingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SensitiveDataLimitUseNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SaleOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SharingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|TargetedAdvertisingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|SensitiveDataProcessing|2 bit int list of size 12. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|KnownChildSensitiveDataConsents|2 bit int list of size 2. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|PersonalDataConsents|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|MspaCoveredTransaction|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|MspaOptOutOptionMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|MspaServiceProviderMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usnat|7|GpcSegmentType|2 bit int. Value is 1|
|usnat|7|GpcSegmentIncluded|Boolean. Default value is true|
|usnat|7|Gpc|Boolean|
|usca|8|Version|6 bit int. Value is 1|
|usca|8|SaleOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|SharingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|SensitiveDataLimitUseNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|SaleOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|SharingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|SensitiveDataProcessing|2 bit int list of size 9. 0=Not applicable, 1=Yes, 2=No|
|usca|8|KnownChildSensitiveDataConsents|2 bit int list of size 2. 0=Not applicable, 1=Yes, 2=No|
|usca|8|PersonalDataConsents|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|MspaCoveredTransaction|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|MspaOptOutOptionMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|MspaServiceProviderMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usca|8|GpcSegmentType|2 bit int. Value is 1|
|usca|8|GpcSegmentIncluded|Boolean. Default value is true|
|usca|8|Gpc|Boolean|
|usva|9|Version|6 bit int. Value is 1|
|usva|9|SharingNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|SaleOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|TargetedAdvertisingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|SaleOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|TargetedAdvertisingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|SensitiveDataProcessing|2 bit int list of size 8. 0=Not applicable, 1=Yes, 2=No|
|usva|9|KnownChildSensitiveDataConsents|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|MspaCoveredTransaction|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|MspaOptOutOptionMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usva|9|MspaServiceProviderMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|Version|6 bit int. Value is 1|
|usco|10|SharingNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|SaleOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|TargetedAdvertisingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|SaleOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|TargetedAdvertisingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|SensitiveDataProcessing|2 bit int list of size 7. 0=Not applicable, 1=Yes, 2=No|
|usco|10|KnownChildSensitiveDataConsents|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|MspaCoveredTransaction|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|MspaOptOutOptionMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|MspaServiceProviderMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usco|10|GpcSegmentType|2 bit int. Value is 1|
|usco|10|GpcSegmentIncluded|Boolean. Default value is true|
|usco|10|Gpc|Boolean|
|usut|11|Version|6 bit int. Value is 1|
|usut|11|SharingNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|SaleOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|TargetedAdvertisingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|SensitiveDataProcessingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|SaleOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|TargetedAdvertisingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|SensitiveDataProcessing|2 bit int list of size 8. 0=Not applicable, 1=Yes, 2=No|
|usut|11|KnownChildSensitiveDataConsents|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|MspaCoveredTransaction|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|MspaOptOutOptionMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usut|11|MspaServiceProviderMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|Version|6 bit int. Value is 1|
|usct|12|SharingNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|SaleOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|TargetedAdvertisingOptOutNotice|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|SaleOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|TargetedAdvertisingOptOut|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|SensitiveDataProcessing|2 bit int list of size 8. 0=Not applicable, 1=Yes, 2=No|
|usct|12|KnownChildSensitiveDataConsents|2 bit int list of size 3. 0=Not applicable, 1=Yes, 2=No|
|usct|12|MspaCoveredTransaction|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|MspaOptOutOptionMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|MspaServiceProviderMode|2 bit int. 0=Not applicable, 1=Yes, 2=No|
|usct|12|GpcSegmentType|2 bit int. Value is 1|
|usct|12|GpcSegmentIncluded|Boolean. Default value is true|
|usct|12|Gpc|Boolean|

## Contributing

Here you can find the [contributing guide](CONTRIBUTING.md) to help maintain and update the library. This library is managed by the Code Libraries Subgroup of the Global Privacy Working Group at the IAB Tech Lab. To join the group, please reach out to support@iabtechlab.com.
Expand Down
27 changes: 17 additions & 10 deletions iabgpp-encoder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.iabgpp</groupId>
<artifactId>iabgpp-core</artifactId>
<version>4.0.0-RC1</version>
<version>4.0.0-SNAPSHOT</version>
</parent>

<artifactId>iabgpp-encoder</artifactId>
Expand All @@ -26,7 +26,22 @@
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.diffplug.spotless</groupId>
<artifactId>spotless-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
Expand All @@ -36,14 +51,6 @@
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand Down
Loading
Loading