// 
// Decompiled by Procyon v0.6.0
// 

package com.google.common.flogger.backend;

import java.math.BigDecimal;
import java.math.BigInteger;

public enum FormatType
{
    GENERAL(false, true) {
        @Override
        public boolean canFormat(final Object arg) {
            return true;
        }
    }, 
    BOOLEAN(false, false) {
        @Override
        public boolean canFormat(final Object arg) {
            return arg instanceof Boolean;
        }
    }, 
    CHARACTER(false, false) {
        @Override
        public boolean canFormat(final Object arg) {
            return arg instanceof Character || ((arg instanceof Integer || arg instanceof Byte || arg instanceof Short) && Character.isValidCodePoint(((Number)arg).intValue()));
        }
    }, 
    INTEGRAL(true, false) {
        @Override
        public boolean canFormat(final Object arg) {
            return arg instanceof Integer || arg instanceof Long || arg instanceof Byte || arg instanceof Short || arg instanceof BigInteger;
        }
    }, 
    FLOAT(true, true) {
        @Override
        public boolean canFormat(final Object arg) {
            return arg instanceof Double || arg instanceof Float || arg instanceof BigDecimal;
        }
    };
    
    private final boolean isNumeric;
    private final boolean supportsPrecision;
    
    private FormatType(final boolean isNumeric, final boolean supportsPrecision) {
        this.isNumeric = isNumeric;
        this.supportsPrecision = supportsPrecision;
    }
    
    boolean supportsPrecision() {
        return this.supportsPrecision;
    }
    
    public boolean isNumeric() {
        return this.isNumeric;
    }
    
    public abstract boolean canFormat(final Object p0);
}
