Klasse DBusObjects

java.lang.Object
org.freedesktop.dbus.utils.DBusObjects

public final class DBusObjects extends Object
Various validations.
Seit:
5.0.0 - 2023-11-08
Autor:
hypfvieh
  • Methodendetails

    • requireObjectPath

      public static String requireObjectPath(String _objectPath) throws InvalidObjectPathException
      Ensures given string is a valid object path.
      Parameter:
      _objectPath - string to check
      Gibt zurück:
      input string if valid
      Löst aus:
      InvalidObjectPathException - when input is not a valid object path
    • requireBusName

      public static String requireBusName(String _busName) throws InvalidBusNameException
      Ensures given string is a valid bus name.
      Parameter:
      _busName - string to check
      Gibt zurück:
      input if valid
      Löst aus:
      InvalidBusNameException - when input is not a valid bus name
    • requireBusName

      public static String requireBusName(String _busName, String _customMessage) throws InvalidBusNameException
      Ensures given string is a valid bus name.
      Parameter:
      _busName - string to check
      _customMessage - custom exception message
      Gibt zurück:
      input if valid
      Löst aus:
      InvalidBusNameException - when input is not a valid bus name
    • requireNotBusName

      public static String requireNotBusName(String _busName, String _customMessage) throws InvalidBusNameException
      Ensures given string is NOT a valid bus name.
      Parameter:
      _busName - string to check
      _customMessage - custom exception message
      Gibt zurück:
      input if valid
      Löst aus:
      InvalidBusNameException - when input is a valid bus name
    • requireConnectionId

      public static String requireConnectionId(String _connId) throws InvalidBusNameException
      Ensures given string is a valid connection Id.
      Parameter:
      _connId - string to check
      Gibt zurück:
      input if valid
      Löst aus:
      InvalidBusNameException - when input is not a valid connection Id
    • requireBusNameOrConnectionId

      public static String requireBusNameOrConnectionId(String _busNameOrConnId) throws InvalidBusNameException
      Ensures given string is a valid bus name or connection Id.
      Parameter:
      _busNameOrConnId - string to check
      Gibt zurück:
      input if valid
      Löst aus:
      InvalidBusNameException - when input is not a valid bus name or connection Id
    • validateBusName

      public static boolean validateBusName(String _busName)
      Checks if input is valid bus name.
      Parameter:
      _busName - input to check
      Gibt zurück:
      true if valid
    • validateNotBusName

      public static boolean validateNotBusName(String _busName)
      Checks if input is NOT a valid bus name.
      Parameter:
      _busName - input to check
      Gibt zurück:
      true if invalid
    • validateObjectPath

      public static boolean validateObjectPath(String _objectPath)
      Checks if input is a valid object path.
      Parameter:
      _objectPath - input to check
      Gibt zurück:
      true if valid
    • validateNotObjectPath

      public static boolean validateNotObjectPath(String _objectPath)
      Checks if input is NOT a valid object path.
      Parameter:
      _objectPath - input to check
      Gibt zurück:
      true if invalid
    • validateNotConnectionId

      public static boolean validateNotConnectionId(String _connectionId)
      Checks if input is NOT a valid connection Id.
      Parameter:
      _connectionId - input to check
      Gibt zurück:
      true if invalid
    • validateConnectionId

      public static boolean validateConnectionId(String _connectionId)
      Checks if input is a valid connection Id.
      Parameter:
      _connectionId - input to check
      Gibt zurück:
      true if valid
    • requireNotNull

      public static <T, X extends Exception> T requireNotNull(T _input, Supplier<X> _exception) throws X
      Ensure given value is not null.
      Typparameter:
      T - input type
      X - exception type to throw
      Parameter:
      _input - input to validate
      _exception - supplier providing exception which will be thrown if input is null
      Gibt zurück:
      input if not null
      Löst aus:
      X - exception provided by supplier thrown when input was null
    • ensurePublicInterfaces

      public static void ensurePublicInterfaces(Object _object) throws InvalidInterfaceSignature
      Ensures that all interfaces found on the given object a public accessable.
      Parameter:
      _object - object to check
      Löst aus:
      InvalidInterfaceSignature - when there is any interface on the given object which is non public