Package lib.dto

Class DTOParser

java.lang.Object
lib.dto.DTOParser

public final class DTOParser extends Object
Static class which parse DTOs from/to byte[] and JSON
  • Method Details

    • parseProjectDTO

      public static ProjectDTO parseProjectDTO(String string)
      Create a ProjectDTO from JSON string
      Parameters:
      string - the JSON
      Returns:
      a ProjectDTO
    • parseProjectDTO

      public static ProjectDTO parseProjectDTO(byte[] bytes)
      Create a ProjectDTO from bytes
      Parameters:
      bytes - the array of bytes
      Returns:
      a ProjectDTO
    • parsePackageDTO

      public static PackageDTO parsePackageDTO(String string)
      Create a PackageDTO from JSON string
      Parameters:
      string - the JSON
      Returns:
      a PackageDTO
    • parsePackageDTO

      public static PackageDTO parsePackageDTO(byte[] bytes)
      Create a PackageDTO from bytes
      Parameters:
      bytes - the array of bytes
      Returns:
      a PackageDTO
    • parseClassInterfaceDTO

      public static ClassInterfaceDTO parseClassInterfaceDTO(String string)
      Create a ClassInterfaceDTO from JSON string
      Parameters:
      string - the JSON
      Returns:
      a ClassInterfaceDTO
    • parseClassInterfaceDTO

      public static ClassInterfaceDTO parseClassInterfaceDTO(byte[] bytes)
      Create a ClassInterfaceDTO from bytes
      Parameters:
      bytes - the array of bytes
      Returns:
      a ClassInterfaceDTO
    • parseMethodDTO

      public static MethodDTO parseMethodDTO(String string)
      Create a MethodDTO from JSON string
      Parameters:
      string - the JSON
      Returns:
      a MethodDTO
    • parseMethodDTO

      public static MethodDTO parseMethodDTO(byte[] bytes)
      Create a MethodDTO from bytes
      Parameters:
      bytes - the array of bytes
      Returns:
      a MethodDTO
    • parseFieldDTO

      public static FieldDTO parseFieldDTO(String string)
      Create a FieldDTO from JSON string
      Parameters:
      string - the JSON
      Returns:
      a FieldDTO
    • parseFieldDTO

      public static FieldDTO parseFieldDTO(byte[] bytes)
      Create a FieldDTO from bytes
      Parameters:
      bytes - the array of bytes
      Returns:
      a FieldDTO
    • parseString

      public static String parseString(Object dto)
      Create a JSON String which represents the object passed
      Parameters:
      dto - the dto to be parsed
      Returns:
      a JSON String
    • parseStringToPrettyJSON

      public static String parseStringToPrettyJSON(Object dto)
      Create a formatted JSON String which represents the object passed
      Parameters:
      dto - the dto to be parsed
      Returns:
      a formatted JSON String
    • parseBytes

      public static byte[] parseBytes(Object dto)
      Create an array of bytes which represents the object passed
      Parameters:
      dto - the dto to be parsed
      Returns:
      an array of bytes