Code example for DatatypeFactory

Methods: newDuration

0
        setTypeClass(Duration.class);
    } 
 
    @Override 
    public Object readObject(MessageReader reader, Context context) {
        return dtFactory.newDuration(reader.getValue().trim());
    } 
 
    @Override 
    public void writeObject(Object object, MessageWriter writer, Context context) {
        writer.writeValue(((Duration)object).toString());
    } 
} 
Experience pair programming with AI  Get Codota for Java