public static SortField buildSortField(Map<String, Object> conf) {
    """
	Builds a {@link SortField} from a configuration map. The map can contains up to three fields: field (name), reverse
	(true/false) and type {@link SortField.Type}.
	
	@param conf
	
	@return
    """

    final String field = Optional.ofNullable((String) conf.get("field")).orElse(null);
    final String type = Optional.ofNullable(((String) conf.get("type")).toUpperCase()).orElse(SortField.Type.STRING.name());
    final Boolean reverse = Optional.ofNullable((Boolean) conf.get("reverse")).orElse(false);

    SortField sortField = new SortField(field, SortField.Type.valueOf(type), reverse);

    return sortField;
  }
public static SortField buildSortField(Map<String, Object> conf) {

    final String field = Optional.ofNullable((String) conf.get("field")).orElse(null);
    final String type = Optional.ofNullable(((String) conf.get("type")).toUpperCase()).orElse(SortField.Type.STRING.name());
    final Boolean reverse = Optional.ofNullable((Boolean) conf.get("reverse")).orElse(false);

    SortField sortField = new SortField(field, SortField.Type.valueOf(type), reverse);

    return sortField;
  }
public static SortField buildSortField ( Map < String , Object > conf ) { final String field = Optional . ofNullable ( ( String ) conf . get ( "field" ) ) . orElse ( null ) ; final String type = Optional . ofNullable ( ( ( String ) conf . get ( "type" ) ) . toUpperCase ( ) ) . orElse ( SortField . Type . STRING . name ( ) ) ; final Boolean reverse = Optional . ofNullable ( ( Boolean ) conf . get ( "reverse" ) ) . orElse ( false ) ; SortField sortField = new SortField ( field , SortField . Type . valueOf ( type ) , reverse ) ; return sortField ; }
Builds a {@link SortField} from a configuration map. The map can contains up to three fields: field (name), reverse
(true/false) and type {@link SortField.Type}.

@param conf

@return
Builds a { @link SortField } from a configuration map . The map can contains up to three fields : field ( name ) reverse ( true / false ) and type { @link SortField . Type } .