public static long convertDuration(final String fromUnit,final String toUnit,long value){
  TimeUnit fromTimeUnit=toTimeUnit(fromUnit);
  TimeUnit toTimeUnit=toTimeUnit(toUnit);
  if (fromTimeUnit != null && toTimeUnit != null) {
    return toTimeUnit.convert(value,fromTimeUnit);
  }
 else {
    throw new DSSException("Cannot convert duration with args (" + fromUnit + ", "+ toUnit+ ", "+ value+ ")");
  }
}

public static long convertDuration ( final String fromUnit , final String toUnit , long value ) { TimeUnit fromTimeUnit = toTimeUnit ( fromUnit ) ; TimeUnit toTimeUnit = toTimeUnit ( toUnit ) ; if ( fromTimeUnit != null && toTimeUnit != null ) { return toTimeUnit . convert ( value , fromTimeUnit ) ; } else { throw new DSSException ( "Cannot convert duration with args (" + fromUnit + ", " + toUnit + ", " + value + ")" ) ; } }
converts the given time duration ( value ) in the given unit ( fromunit ) to given unit ( tounit ) .
