/** * Gets the value typed using the appropriate type conversion from {@link Types} * * @see #getValue() * @return The appropriate type conversion, 0 if no appropriate value is available */ default long getLong() { return getLong(NUMBER_DEF); }
/** * Gets the value typed using the appropriate type conversion from {@link Types} * * @see #getValue() * @return The appropriate type conversion, 0 if no appropriate value is available */ default long getLong() { return getLong(NUMBER_DEF); }
/** * Gets the value typed using the appropriate type conversion from {@link Types} * * @see #getValue() * @return The appropriate type conversion, 0 if no appropriate value is available */ default long getLong() { return getLong(NUMBER_DEF); }
@Override public Duration deserialize(TypeToken<?> type, ConfigurationNode value) throws ObjectMappingException { return Duration.ofSeconds(value.getLong()); }
@Override public Number deserialize(TypeToken<?> type, ConfigurationNode value) throws InvalidTypeException { type = type.wrap(); Class<?> clazz = type.getRawType(); if (Integer.class.equals(clazz)) { return value.getInt(); } else if (Long.class.equals(clazz)) { return value.getLong(); } else if (Short.class.equals(clazz)) { return (short) value.getInt(); } else if (Byte.class.equals(clazz)) { return (byte) value.getInt(); } else if (Float.class.equals(clazz)) { return value.getFloat(); } else if (Double.class.equals(clazz)) { return value.getDouble(); } return null; }
@Override public Number deserialize(@NonNull TypeToken<?> type, @NonNull ConfigurationNode value) throws InvalidTypeException { type = type.wrap(); Class<?> clazz = type.getRawType(); if (Integer.class.equals(clazz)) { return value.getInt(); } else if (Long.class.equals(clazz)) { return value.getLong(); } else if (Short.class.equals(clazz)) { return (short) value.getInt(); } else if (Byte.class.equals(clazz)) { return (byte) value.getInt(); } else if (Float.class.equals(clazz)) { return value.getFloat(); } else if (Double.class.equals(clazz)) { return value.getDouble(); } return null; }
@Override public Number deserialize(@NonNull TypeToken<?> type, @NonNull ConfigurationNode value) throws InvalidTypeException { type = type.wrap(); Class<?> clazz = type.getRawType(); if (Integer.class.equals(clazz)) { return value.getInt(); } else if (Long.class.equals(clazz)) { return value.getLong(); } else if (Short.class.equals(clazz)) { return (short) value.getInt(); } else if (Byte.class.equals(clazz)) { return (byte) value.getInt(); } else if (Float.class.equals(clazz)) { return value.getFloat(); } else if (Double.class.equals(clazz)) { return value.getDouble(); } return null; }