public static <T>Range<T> valueOf(String s,Class<T> clazz){
  char lbm=s.charAt(0);
  if (lbm != '[' && lbm != '(')   throw new IllegalArgumentException(s);
  char ubm=s.charAt(s.length() - 1);
  if (ubm != ']' && ubm != ')')   throw new IllegalArgumentException(s);
  BoundType lbt=lbm == '[' ? BoundType.CLOSED : BoundType.OPEN;
  BoundType ubt=ubm == ']' ? BoundType.CLOSED : BoundType.OPEN;
  s=s.substring(1,s.length() - 1);
  String[] parts=s.split("\\.\\.");
  String lbs=parts[0];
  String ubs=parts[1];
  T lowerBound=lbs.equals("*") ? null : boundValue(lbs,clazz);
  T upperBound=ubs.equals("*") ? null : boundValue(ubs,clazz);
  return range(lowerBound,lbt,upperBound,ubt);
}

public static < T > Range < T > valueOf ( String s , Class < T > clazz ) { char lbm = s . charAt ( 0 ) ; if ( lbm != '[' && lbm != '(' ) throw new IllegalArgumentException ( s ) ; char ubm = s . charAt ( s . length ( ) - 1 ) ; if ( ubm != ']' && ubm != ')' ) throw new IllegalArgumentException ( s ) ; BoundType lbt = lbm == '[' ? BoundType . CLOSED : BoundType . OPEN ; BoundType ubt = ubm == ']' ? BoundType . CLOSED : BoundType . OPEN ; s = s . substring ( 1 , s . length ( ) - 1 ) ; String [ ] parts = s . split ( "\\.\\." ) ; String lbs = parts [ 0 ] ; String ubs = parts [ 1 ] ; T lowerBound = lbs . equals ( "*" ) ? null : boundValue ( lbs , clazz ) ; T upperBound = ubs . equals ( "*" ) ? null : boundValue ( ubs , clazz ) ; return range ( lowerBound , lbt , upperBound , ubt ) ; }
create a range from a string produced by tostring ( )
