sls-versions/src/main/java/com/palantir/sls/versions/OrderableSlsVersion.java
/** The same as {@link #valueOf(String)}, but will return {@link Optional#empty} if the format is invalid. */
The same as  #valueOf(String), but will return  Optional#empty if the format is invalid.
The same as #valueOf ( String ) but will return Optional#empty if the format is invalid .
public static Optional<OrderableSlsVersion> safeValueOf(String value) {
        if (value == null) {
            return Optional.empty();
        }
        for (SlsVersionType type : ORDERED_VERSION_TYPES) {
            MatchResult groups = type.getParser().tryParse(value);
            if (groups != null) {
                return Optional.of(construct(type, value, groups));
            }
        }
        return Optional.empty();
    }
public static Optional < OrderableSlsVersion > safeValueOf ( String value ) { if ( value == null ) { return Optional . empty ( ) ; } for ( SlsVersionType type : ORDERED_VERSION_TYPES ) { MatchResult groups = type . getParser ( ) . tryParse ( value ) ; if ( groups != null ) { return Optional . of ( construct ( type , value , groups ) ) ; } } return Optional . empty ( ) ; }
The same as {@link #valueOf(String)}, but will return {@link Optional#empty} if the format is invalid.
The same as { @link #valueOf ( String ) } but will return { @link Optional#empty } if the format is invalid .