Class ServiceNameMappings

java.lang.Object
com.sap.cloud.sdk.datamodel.odata.utility.ServiceNameMappings

public class ServiceNameMappings extends Object
This class is used to read and write service name mappings from a file.
  • Constructor Details

    • ServiceNameMappings

      public ServiceNameMappings(@Nonnull Path file)
      Creates a new instance of ServiceNameMappings with the specified file.
      Parameters:
      file - the file to read and write mappings from/to
  • Method Details

    • save

      public void save() throws IOException
      Saves the mappings to the file.
      Throws:
      IOException - if an error occurs while writing to the file
    • getString

      @Nonnull public Optional<String> getString(@Nonnull String key)
      Gets the value of the specified key.
      Parameters:
      key - the key to get the value for
      Returns:
      the optional value of the key.
    • putString

      public void putString(@Nonnull String key, @Nonnull String value, @Nonnull String... comments)
      Adds a new mapping to the file.
      Parameters:
      key - the key to add
      value - the value to add
      comments - the comments to add, optional