@Test public void asLong_isLongValue_returnsLong() throws Exception { long longValue = 555L; FirebaseRemoteConfigValue value = new FirebaseRemoteConfigValueImpl(Long.toString(longValue), VALUE_SOURCE_REMOTE); assertThat(value.asLong()).isEqualTo(longValue); }
@Override public long asLong() { if (source == FirebaseRemoteConfig.VALUE_SOURCE_STATIC) { return FirebaseRemoteConfig.DEFAULT_VALUE_FOR_LONG; } String valueAsString = asTrimmedString(); try { return Long.valueOf(valueAsString); } catch (NumberFormatException e) { throw new IllegalArgumentException( String.format(ILLEGAL_ARGUMENT_STRING_FORMAT, valueAsString, "long"), e); } }
FirebaseRemoteConfigValueImpl implements FirebaseRemoteConfigValue { @Override public long asLong() { if (source == FirebaseRemoteConfig.VALUE_SOURCE_STATIC) { return FirebaseRemoteConfig.DEFAULT_VALUE_FOR_LONG; } String valueAsString = asTrimmedString(); try { return Long.valueOf(valueAsString); } catch (NumberFormatException e) { throw new IllegalArgumentException( String.format(ILLEGAL_ARGUMENT_STRING_FORMAT, valueAsString, "long"), e); } } }
FirebaseRemoteConfigValueImpl implements FirebaseRemoteConfigValue { @Override public long asLong() { if (source == FirebaseRemoteConfig.VALUE_SOURCE_STATIC) { return FirebaseRemoteConfig.DEFAULT_VALUE_FOR_LONG; } String valueAsString = asTrimmedString(); try { return Long.valueOf(valueAsString); } catch (NumberFormatException e) { throw new IllegalArgumentException( String.format(ILLEGAL_ARGUMENT_STRING_FORMAT, valueAsString, "long"), e); } } FirebaseRemoteConfigValueImpl(String value, int source); }
FirebaseRemoteConfigValueImpl implements FirebaseRemoteConfigValue { @Override public long asLong() { if (source == FirebaseRemoteConfig.VALUE_SOURCE_STATIC) { return FirebaseRemoteConfig.DEFAULT_VALUE_FOR_LONG; } String valueAsString = asTrimmedString(); try { return Long.valueOf(valueAsString); } catch (NumberFormatException e) { throw new IllegalArgumentException( String.format(ILLEGAL_ARGUMENT_STRING_FORMAT, valueAsString, "long"), e); } } FirebaseRemoteConfigValueImpl(String value, int source); @Override long asLong(); @Override double asDouble(); @Override String asString(); @Override byte[] asByteArray(); @Override boolean asBoolean(); @Override int getSource(); }
FirebaseRemoteConfigValueImpl implements FirebaseRemoteConfigValue { @Override public long asLong() { if (source == FirebaseRemoteConfig.VALUE_SOURCE_STATIC) { return FirebaseRemoteConfig.DEFAULT_VALUE_FOR_LONG; } String valueAsString = asTrimmedString(); try { return Long.valueOf(valueAsString); } catch (NumberFormatException e) { throw new IllegalArgumentException( String.format(ILLEGAL_ARGUMENT_STRING_FORMAT, valueAsString, "long"), e); } } FirebaseRemoteConfigValueImpl(String value, int source); @Override long asLong(); @Override double asDouble(); @Override String asString(); @Override byte[] asByteArray(); @Override boolean asBoolean(); @Override int getSource();  }