Example usage for java.text Format getClass

List of usage examples for java.text Format getClass

Introduction

In this page you can find the example usage for java.text Format getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:ca.sqlpower.dao.session.FormatConverter.java

public String convertToSimpleType(Format convertFrom, Object... additionalInfo) {
    if (convertFrom instanceof DecimalFormat) {
        DecimalFormat decimal = (DecimalFormat) convertFrom;
        return DecimalFormat.class.getSimpleName() + DELIMITER + decimal.toPattern();
    } else if (convertFrom instanceof SimpleDateFormat) {
        SimpleDateFormat date = (SimpleDateFormat) convertFrom;
        return SimpleDateFormat.class.getSimpleName() + DELIMITER + date.toPattern();
    } else {/*from   w  ww  . j a  va2s .c om*/
        throw new IllegalStateException("Unknown format to convert from " + convertFrom.getClass());
    }
}