@Override public boolean isSet(DatatypeConstants.Field field){
  if (field == null) {
    String methodName="mf.javax.xml.datatype.Duration" + "#isSet(DatatypeConstants.Field field)";
    throw new NullPointerException(DatatypeMessageFormatter.formatMessage(null,"FieldCannotBeNull",new Object[]{methodName}));
  }
  if (field == DatatypeConstants.YEARS) {
    return years != null;
  }
  if (field == DatatypeConstants.MONTHS) {
    return months != null;
  }
  if (field == DatatypeConstants.DAYS) {
    return days != null;
  }
  if (field == DatatypeConstants.HOURS) {
    return hours != null;
  }
  if (field == DatatypeConstants.MINUTES) {
    return minutes != null;
  }
  if (field == DatatypeConstants.SECONDS) {
    return seconds != null;
  }
  String methodName="mf.javax.xml.datatype.Duration" + "#isSet(DatatypeConstants.Field field)";
  throw new IllegalArgumentException(DatatypeMessageFormatter.formatMessage(null,"UnknownField",new Object[]{methodName,field.toString()}));
}

@ Override public boolean isSet ( DatatypeConstants . Field field ) { if ( field == null ) { String methodName = "mf.javax.xml.datatype.Duration" + "#isSet(DatatypeConstants.Field field)" ; throw new NullPointerException ( DatatypeMessageFormatter . formatMessage ( null , "FieldCannotBeNull" , new Object [ ] { methodName } ) ) ; } if ( field == DatatypeConstants . YEARS ) { return years != null ; } if ( field == DatatypeConstants . MONTHS ) { return months != null ; } if ( field == DatatypeConstants . DAYS ) { return days != null ; } if ( field == DatatypeConstants . HOURS ) { return hours != null ; } if ( field == DatatypeConstants . MINUTES ) { return minutes != null ; } if ( field == DatatypeConstants . SECONDS ) { return seconds != null ; } String methodName = "mf.javax.xml.datatype.Duration" + "#isSet(DatatypeConstants.Field field)" ; throw new IllegalArgumentException ( DatatypeMessageFormatter . formatMessage ( null , "UnknownField" , new Object [ ] { methodName , field . toString ( ) } ) ) ; }
checks if a field is set . < p / > a field of a duration object may or may not be present . this method can be used to test if a field is present .
