code: String optionalOr(@Nonnull String str, String defaults) {
          return str.isEmpty() ? defaults : str;
      }
docs: Check if a given non-null String instance is "missing" according to ProtoBuf's
  missing field rules. If the String is missing, the given default value will be
  returned. Otherwise, the string itself will be returned.
  
  @param str the input String
  @param defaults the default value for the string
  @return 'str' if it is not empty according to ProtoBuf rules; 'defaults' otherwise