Class DTOConverters

java.lang.Object
org.apache.gravitino.dto.util.DTOConverters

public class DTOConverters extends Object
Utility class for converting between DTOs and domain objects.
  • Method Details

    • toDTO

      public static AuditDTO toDTO(Audit audit)
      Converts a Audit to a AuditDTO.
      Parameters:
      audit - The audit.
      Returns:
      The audit DTO.
    • toDTO

      public static OwnerDTO toDTO(Owner owner)
      Converts a Owner to a OwnerDTO.
      Parameters:
      owner - The owner.
      Returns:
      The owner DTO.
    • toDTO

      public static MetalakeDTO toDTO(Metalake metalake)
      Converts a Metalake to a MetalakeDTO.
      Parameters:
      metalake - The metalake.
      Returns:
      The metalake DTO.
    • toDTO

      public static PartitionDTO toDTO(Partition partition)
      Converts a Partition to a PartitionDTO.
      Parameters:
      partition - The partition.
      Returns:
      The partition DTO.
    • toDTO

      public static CatalogDTO toDTO(Catalog catalog)
      Converts a Catalog to a CatalogDTO.
      Parameters:
      catalog - The catalog.
      Returns:
      The catalog DTO.
    • toDTO

      public static SchemaDTO toDTO(Schema schema)
      Converts a Schema to a SchemaDTO.
      Parameters:
      schema - The schema.
      Returns:
      The schema DTO.
    • toDTO

      public static ColumnDTO toDTO(Column column)
      Converts a Column to a ColumnDTO.
      Parameters:
      column - The column.
      Returns:
      The column DTO.
    • toDTO

      public static TableDTO toDTO(Table table)
      Converts a table implementation to a TableDTO.
      Parameters:
      table - The table implementation.
      Returns:
      The table DTO.
    • toDTO

      public static DistributionDTO toDTO(Distribution distribution)
      Converts a Distribution implementation to a DistributionDTO.
      Parameters:
      distribution - The distribution implementation.
      Returns:
      The distribution DTO.
    • toDTO

      public static SortOrderDTO toDTO(SortOrder sortOrder)
      Converts a SortOrder implementation to a SortOrderDTO.
      Parameters:
      sortOrder - The sort order implementation.
      Returns:
      The sort order DTO.
    • toDTO

      public static Partitioning toDTO(Transform transform)
      Converts a Transform implementation to a Partitioning DTO.
      Parameters:
      transform - The transform implementation.
      Returns:
      The partitioning DTO.
    • toDTO

      public static IndexDTO toDTO(Index index)
      Converts an index implementation to an IndexDTO.
      Parameters:
      index - The index implementation.
      Returns:
      The index DTO.
    • toDTO

      public static UserDTO toDTO(User user)
      Converts a user implementation to a UserDTO.
      Parameters:
      user - The user implementation.
      Returns:
      The user DTO.
    • toDTO

      public static GroupDTO toDTO(Group group)
      Converts a group implementation to a GroupDTO.
      Parameters:
      group - The group implementation.
      Returns:
      The group DTO.
    • toDTO

      public static RoleDTO toDTO(Role role)
      Converts a role implementation to a RoleDTO.
      Parameters:
      role - The role implementation.
      Returns:
      The role DTO.
    • toDTO

      public static SecurableObjectDTO toDTO(SecurableObject securableObject)
      Converts a securable object implementation to a SecurableObjectDTO.
      Parameters:
      securableObject - The securable object implementation.
      Returns:
      The securable object DTO.
    • toDTO

      public static PrivilegeDTO toDTO(Privilege privilege)
      Converts a privilege implementation to a PrivilegeDTO.
      Parameters:
      privilege - The privilege implementation.
      Returns:
      The privilege DTO.
    • toDTO

      public static MetadataObjectDTO toDTO(MetadataObject metadataObject)
      Converts a MetadataObject to a MetadataObjectDTO.
      Parameters:
      metadataObject - The metadata object to be converted.
      Returns:
      The metadata object DTO.
    • toDTO

      public static TagDTO toDTO(Tag tag, Optional<Boolean> inherited)
      Converts a Tag to a TagDTO.
      Parameters:
      tag - The tag to be converted.
      inherited - The inherited flag.
      Returns:
      The tag DTO.
    • toDTO

      public static PolicyContentDTO toDTO(PolicyContent policyContent)
      Converts a PolicyContent to a PolicyContentDTO.
      Parameters:
      policyContent - The policyContent to be converted.
      Returns:
      The policy content DTO.
    • toDTO

      public static CredentialDTO[] toDTO(Credential[] credentials)
      Converts credentials to CredentialDTOs.
      Parameters:
      credentials - the credentials to be converted.
      Returns:
      The credential DTOs.
    • toDTO

      public static CredentialDTO toDTO(Credential credential)
      Converts a Credential to a CredentialDTO.
      Parameters:
      credential - the credential to be converted.
      Returns:
      The credential DTO.
    • toFunctionArg

      public static FunctionArg toFunctionArg(Expression expression)
      Converts an Expression to an FunctionArg DTO.
      Parameters:
      expression - The expression to be converted.
      Returns:
      The expression DTO.
    • toFunctionArg

      public static FunctionArg[] toFunctionArg(Expression[] expressions)
      Converts an array of Expressions to an array of FunctionArg DTOs.
      Parameters:
      expressions - The expressions to be converted.
      Returns:
      The array of FunctionArg DTOs.
    • toDTO

      public static FilesetDTO toDTO(Fileset fileset)
      Converts a Fileset to a FilesetDTO.
      Parameters:
      fileset - The fileset to be converted.
      Returns:
      The fileset DTO.
    • toDTO

      public static FileInfoDTO[] toDTO(FileInfo[] files)
      Converts array of FileInfo to array of FileInfoDTO.
      Parameters:
      files - The FileInfo array to convert.
      Returns:
      The converted FileInfoDTO array.
    • toDTO

      public static TopicDTO toDTO(Topic topic)
      Converts a Topic to a TopicDTO.
      Parameters:
      topic - The topic to be converted.
      Returns:
      The topic DTO.
    • toDTO

      public static ModelDTO toDTO(Model model)
      Converts a Model to a ModelDTO.
      Parameters:
      model - The model to be converted.
      Returns:
      The model DTO.
    • toDTO

      public static ModelVersionDTO toDTO(ModelVersion modelVersion)
      Converts a ModelVersion to a ModelVersionDTO.
      Parameters:
      modelVersion - The model version to be converted.
      Returns:
      The model version DTO.
    • toDTOs

      public static ModelVersionDTO[] toDTOs(ModelVersion[] modelVersions)
      Converts an array of ModelVersions to an array of ModelVersionDTOs.
      Parameters:
      modelVersions - The modelVersions to be converted.
      Returns:
      The array of ModelVersionDTOs.
    • toDTOs

      public static ColumnDTO[] toDTOs(Column[] columns)
      Converts an array of Columns to an array of ColumnDTOs.
      Parameters:
      columns - The columns to be converted.
      Returns:
      The array of ColumnDTOs.
    • toDTOs

      public static SortOrderDTO[] toDTOs(SortOrder[] sortOrders)
      Converts an array of SortOrders to an array of SortOrderDTOs.
      Parameters:
      sortOrders - The sort orders to be converted.
      Returns:
      The array of SortOrderDTOs.
    • toDTOs

      public static Partitioning[] toDTOs(Transform[] transforms)
      Converts an array of Transforms to an array of Partitioning DTOs.
      Parameters:
      transforms - The transforms to be converted.
      Returns:
      The array of Partitioning DTOs.
    • toDTOs

      public static IndexDTO[] toDTOs(Index[] indexes)
      Converts an array of Indexes to an array of IndexDTOs.
      Parameters:
      indexes - The indexes to be converted.
      Returns:
      The array of IndexDTOs.
    • toDTOs

      public static PartitionDTO[] toDTOs(Partition[] partitions)
      Converts an array of Partitions to an array of PartitionDTOs.
      Parameters:
      partitions - The partitions to be converted.
      Returns:
      The array of PartitionDTOs.
    • toDTOs

      public static CatalogDTO[] toDTOs(Catalog[] catalogs)
      Converts an array of Catalogs to an array of CatalogDTOs.
      Parameters:
      catalogs - The catalogs to be converted.
      Returns:
      The array of CatalogDTOs.
    • toDTOs

      public static UserDTO[] toDTOs(User[] users)
      Converts an array of Users to an array of UserDTOs.
      Parameters:
      users - The users to be converted.
      Returns:
      The array of UserDTOs.
    • toDTOs

      public static GroupDTO[] toDTOs(Group[] groups)
      Converts an array of Groups to an array of GroupDTOs.
      Parameters:
      groups - The groups to be converted.
      Returns:
      The array of GroupDTOs.
    • toDTOs

      public static StatisticDTO[] toDTOs(Statistic[] statistics)
      Converts an array of statistics to an array of StatisticDTOs.
      Parameters:
      statistics - The statistics to be converted.
      Returns:
      The array of StatisticDTOs.
    • fromDTO

      public static Distribution fromDTO(DistributionDTO distributionDTO)
      Converts a DistributionDTO to a Distribution.
      Parameters:
      distributionDTO - The distribution DTO.
      Returns:
      The distribution.
    • fromFunctionArgs

      public static Expression[] fromFunctionArgs(FunctionArg[] args)
      Converts a FunctionArg DTO to an Expression.
      Parameters:
      args - The function argument DTOs to be converted.
      Returns:
      The array of Expressions.
    • fromFunctionArg

      public static Expression fromFunctionArg(FunctionArg arg)
      Converts a FunctionArg DTO to an Expression.
      Parameters:
      arg - The function argument DTO to be converted.
      Returns:
      The expression.
    • fromDTO

      public static Index fromDTO(IndexDTO indexDTO)
      Converts a IndexDTO to an Index.
      Parameters:
      indexDTO - The Index DTO to be converted.
      Returns:
      The index.
    • fromDTOs

      public static Index[] fromDTOs(IndexDTO[] indexDTOs)
      Converts an array of IndexDTOs to an array of Indexes.
      Parameters:
      indexDTOs - The Index DTOs to be converted.
      Returns:
      The array of Indexes.
    • fromDTO

      public static Partition fromDTO(PartitionDTO partitionDTO)
      Converts a PartitionDTO to a Partition.
      Parameters:
      partitionDTO - The partition DTO to be converted.
      Returns:
      The partition.
    • fromDTO

      public static SortOrder fromDTO(SortOrderDTO sortOrderDTO)
      Converts a SortOrderDTO to a SortOrder.
      Parameters:
      sortOrderDTO - The sort order DTO to be converted.
      Returns:
      The sort order.
    • fromDTOs

      public static SortOrder[] fromDTOs(SortOrderDTO[] sortOrderDTO)
      Converts an array of SortOrderDTOs to an array of SortOrders.
      Parameters:
      sortOrderDTO - The sort order DTOs to be converted.
      Returns:
      The array of SortOrders.
    • fromDTOs

      public static Transform[] fromDTOs(Partitioning[] partitioning)
      Converts an array of Partitioning DTOs to an array of Transforms.
      Parameters:
      partitioning - The partitioning DTOs to be converted.
      Returns:
      The array of Transforms.
    • fromDTOs

      public static Column[] fromDTOs(ColumnDTO[] columns)
      Converts a ColumnDTO to a Column.
      Parameters:
      columns - The column DTO to be converted.
      Returns:
      The column.
    • fromDTO

      public static Credential[] fromDTO(CredentialDTO[] credentials)
      Converts CredentialDTO array to credential array.
      Parameters:
      credentials - The credential DTO array to be converted.
      Returns:
      The credential array.
    • fromDTO

      public static Credential fromDTO(CredentialDTO credential)
      Converts a CredentialDTO to a credential.
      Parameters:
      credential - The credential DTO to be converted.
      Returns:
      The credential.
    • fromDTO

      public static Column fromDTO(ColumnDTO column)
      Converts a ColumnDTO to a Column.
      Parameters:
      column - The column DTO to be converted.
      Returns:
      The column.
    • fromDTO

      public static Table fromDTO(TableDTO tableDTO)
      Converts a TableDTO to a Table.
      Parameters:
      tableDTO - The table DTO to be converted.
      Returns:
      The table.
    • fromDTO

      public static Transform fromDTO(Partitioning partitioning)
      Converts a partitioning DTO to a Transform.
      Parameters:
      partitioning - The partitioning DTO to be converted.
      Returns:
      The transform.
    • fromPrivilegeDTO

      public static Privilege fromPrivilegeDTO(PrivilegeDTO privilegeDTO)
      Converts a Privilege DTO to a Privilege
      Parameters:
      privilegeDTO - The privilege DTO to be converted.
      Returns:
      The privilege.
    • fromDTO

      public static JobTemplate fromDTO(JobTemplateDTO jobTemplateDTO)
      Converts a JobTemplateDTO to a JobTemplate.
      Parameters:
      jobTemplateDTO - The job template DTO to be converted.
      Returns:
      The job template.
    • fromDTO

      public static PolicyContent fromDTO(PolicyContentDTO policyContentDTO)
      Converts a PolicyContentDTO to a PolicyContent.
      Parameters:
      policyContentDTO - The policy content DTO to be converted.
      Returns:
      The policy content.