sls-versions/src/main/java/com/palantir/sls/versions/CompactVersion.java
/**
     * Returns an {@link OrderableSlsVersion} equivalent to this object.
     *
     * <p><b>Note</b>: Snapshot versions <i>must</i> include a git hash in the string representation, but because
     * {@link OrderableSlsVersion} does not require equality and because this class' compact representation does not
     * store the string, the git hash will always be set to {@code gaaaaaa}.
     */
Returns an  OrderableSlsVersion equivalent to this object.
Note: Snapshot versions must include a git hash in the string representation, but because
OrderableSlsVersion does not require equality and because this class' compact representation does not
store the string, the git hash will always be set to  gaaaaaa.
Returns an OrderableSlsVersion equivalent to this object . Note : Snapshot versions must include a git hash in the string representation but because OrderableSlsVersion does not require equality and because this class ' compact representation does not store the string the git hash will always be set to gaaaaaa .
public OrderableSlsVersion toSlsVersion() {
        int majorVersionNumber = (int) (msb >> 32) & MASK_20_BITS;
        int minorVersionNumber = (int) (msb >> 12) & MASK_20_BITS;
        int patchVersionNumber = (int) ((msb & MASK_12_BITS) << 8) + (int) ((lsb >> 44) & MASK_8_BITS);
        int priority1 = (int) (lsb >> 20) & MASK_2_BITS;
        int priority2 = (int) (lsb >> 42) & MASK_2_BITS;
        SlsVersionType type = typeFromPriority(priority1, priority2);
        int rcNumber = (int) (lsb >> 22) & MASK_20_BITS;
        int distanceFromVersion = (int) lsb & MASK_20_BITS;
        OptionalInt firstSeq = OptionalInt.empty();
        OptionalInt secondSeq = OptionalInt.empty();
        switch (type) {
            case RELEASE_CANDIDATE:
                firstSeq = OptionalInt.of(rcNumber);
                break;
            case RELEASE_SNAPSHOT:
                firstSeq = OptionalInt.of(distanceFromVersion);
                break;
            case RELEASE_CANDIDATE_SNAPSHOT:
                firstSeq = OptionalInt.of(rcNumber);
                secondSeq = OptionalInt.of(distanceFromVersion);
                break;
            case RELEASE:
            case NON_ORDERABLE:
                break;
        }
        return new OrderableSlsVersion.Builder()
                .majorVersionNumber(majorVersionNumber)
                .minorVersionNumber(minorVersionNumber)
                .patchVersionNumber(patchVersionNumber)
                .type(type)
                .firstSequenceVersionNumber(firstSeq)
                .secondSequenceVersionNumber(secondSeq)
                .value(generateVersionString(
                        majorVersionNumber,
                        minorVersionNumber,
                        patchVersionNumber,
                        type,
                        rcNumber,
                        distanceFromVersion))
                .build();
    }
public OrderableSlsVersion toSlsVersion ( ) { int majorVersionNumber = ( int ) ( msb >> 32 ) & MASK_20_BITS ; int minorVersionNumber = ( int ) ( msb >> 12 ) & MASK_20_BITS ; int patchVersionNumber = ( int ) ( ( msb & MASK_12_BITS ) << 8 ) + ( int ) ( ( lsb >> 44 ) & MASK_8_BITS ) ; int priority1 = ( int ) ( lsb >> 20 ) & MASK_2_BITS ; int priority2 = ( int ) ( lsb >> 42 ) & MASK_2_BITS ; SlsVersionType type = typeFromPriority ( priority1 , priority2 ) ; int rcNumber = ( int ) ( lsb >> 22 ) & MASK_20_BITS ; int distanceFromVersion = ( int ) lsb & MASK_20_BITS ; OptionalInt firstSeq = OptionalInt . empty ( ) ; OptionalInt secondSeq = OptionalInt . empty ( ) ; switch ( type ) { case RELEASE_CANDIDATE : firstSeq = OptionalInt . of ( rcNumber ) ; break ; case RELEASE_SNAPSHOT : firstSeq = OptionalInt . of ( distanceFromVersion ) ; break ; case RELEASE_CANDIDATE_SNAPSHOT : firstSeq = OptionalInt . of ( rcNumber ) ; secondSeq = OptionalInt . of ( distanceFromVersion ) ; break ; case RELEASE : case NON_ORDERABLE : break ; } return new OrderableSlsVersion . Builder ( ) . majorVersionNumber ( majorVersionNumber ) . minorVersionNumber ( minorVersionNumber ) . patchVersionNumber ( patchVersionNumber ) . type ( type ) . firstSequenceVersionNumber ( firstSeq ) . secondSequenceVersionNumber ( secondSeq ) . value ( generateVersionString ( majorVersionNumber , minorVersionNumber , patchVersionNumber , type , rcNumber , distanceFromVersion ) ) . build ( ) ; }
Returns an {@link OrderableSlsVersion} equivalent to this object.
Returns an { @link OrderableSlsVersion } equivalent to this object .