@SuppressWarnings("checkstyle:NPathComplexity")
    private short getAlteredFieldsBitMask() {
        int bitMask = 0;
        bitMask = id != null ? bitMask | ID_BIT_MASK : bitMask;
        bitMask = startTimestamp != null ? bitMask | START_TIMESTAMP_BIT_MASK : bitMask;
        bitMask = stopTimestamp != null ? bitMask | STOP_TIMESTAMP_BIT_MASK : bitMask;
        bitMask = lastAccessTime != null ? bitMask | LAST_ACCESS_TIME_BIT_MASK : bitMask;
        bitMask = timeout != 0L ? bitMask | TIMEOUT_BIT_MASK : bitMask;
        bitMask = expired ? bitMask | EXPIRED_BIT_MASK : bitMask;
        bitMask = host != null ? bitMask | HOST_BIT_MASK : bitMask;
        bitMask = !CollectionUtils.isEmpty(attributes) ? bitMask | ATTRIBUTES_BIT_MASK : bitMask;
        return (short) bitMask;
    }
Returns a bit mask used during serialization indicating which fields have been serialized. Fields that have been
altered (not null and/or not retaining the class defaults) will be serialized and have 1 in their respective
index, fields that are null and/or retain class default values have 0.

@return a bit mask used during serialization indicating which fields have been serialized.
@since 1.0
core/src/main/java/org/apache/shiro/session/mgt/SimpleSession.java