A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/aeron-io/simple-binary-encoding/pull/622 below:

Method For Setting Null Value in Required Fields · Issue #622 · aeron-io/simple-binary-encoding · GitHub

Just a quick question regarding null values for required fields

For example if a timestamp field (uInt64) is specified with presence="required" then why is there a method for setting/getting null value for a required field? If a field is required then there should ideally be no setter method for setting a null value for it

Encoding:

public static long requestTimestampNullValue() {
return -1L;
}

public static long requestTimestampMinValue() {
return 0L;
}

public static long requestTimestampMaxValue() {
return -2L;
}

public XXXXXXXXEncoder requestTimestamp(long value) {
this.buffer.putLong(this.offset + 64, value, ByteOrder.LITTLE_ENDIAN);
return this;
}

Decoder:

public static long requestTimestampNullValue() {
return -1L;
}

public static long requestTimestampMinValue() {
return 0L;
}

public static long requestTimestampMaxValue() {
return -2L;
}

public long requestTimestamp() {
return this.buffer.getLong(this.offset + 64, ByteOrder.LITTLE_ENDIAN);
}


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4