public void maybeSetLegacyObjectMapOrRecordType() {
    if (type == Type.UNKNOWN) {
      type = Type.LEGACY_OBJECT_MAP_OR_RECORD;
    } else if (type == Type.MAP) {
      throw new IllegalStateException(
          "Expected a value of type `legacy_object_map`, got `map`. "
              + "These two map types are not interoperable. "
              + "Use `mapToLegacyObjectMap()` to convert this object to a legacy_object_map.");
    }
  }
public void maybeSetLegacyObjectMapOrRecordType ( ) { if ( type == Type . UNKNOWN ) { type = Type . LEGACY_OBJECT_MAP_OR_RECORD ; } else if ( type == Type . MAP ) { throw new IllegalStateException ( "Expected a value of type `legacy_object_map`, got `map`. " + "These two map types are not interoperable. " + "Use `mapToLegacyObjectMap()` to convert this object to a legacy_object_map." ) ; } }
Sets the internal state to {@link Type#LEGACY_OBJECT_MAP_OR_RECORD}. If the state has already
been set, throws an exception.