class FirebaseRemoteConfigValueImpl implements FirebaseRemoteConfigValue {

  @Override
  public boolean asBoolean() throws IllegalArgumentException {
    if (source == FirebaseRemoteConfig.VALUE_SOURCE_STATIC) {
      return FirebaseRemoteConfig.DEFAULT_VALUE_FOR_BOOLEAN;
    }

    String valueAsString = asTrimmedString();
    if (TRUE_REGEX.matcher(valueAsString).matches()) {
      return true;
    } else if (FALSE_REGEX.matcher(valueAsString).matches()) {
      return false;
    }
    throw new IllegalArgumentException(
        String.format(ILLEGAL_ARGUMENT_STRING_FORMAT, valueAsString, "boolean"));
  }

    FirebaseRemoteConfigValueImpl(String value, int source);

}