Class EntityCsv<T extends EntityInterface>

    • Method Detail

      • toEntity

        protected abstract T toEntity​(org.apache.commons.csv.CSVPrinter resultsPrinter,
                                      org.apache.commons.csv.CSVRecord csvRecord)
                               throws IOException
        Implement this method to a CSV record and turn it into an entity
        Throws:
        IOException
      • toRecord

        protected abstract List<String> toRecord​(T entity)
        Implement this method to export an entity into a list of fields to create a CSV record
      • getOwner

        public EntityReference getOwner​(org.apache.commons.csv.CSVPrinter printer,
                                        org.apache.commons.csv.CSVRecord csvRecord,
                                        int fieldNumber)
                                 throws IOException
        Owner field is in entityType;entityName format
        Throws:
        IOException
      • getOwnerAsUser

        public EntityReference getOwnerAsUser​(org.apache.commons.csv.CSVPrinter printer,
                                              org.apache.commons.csv.CSVRecord csvRecord,
                                              int fieldNumber)
                                       throws IOException
        Owner field is in entityName format
        Throws:
        IOException
      • getBoolean

        protected final Boolean getBoolean​(org.apache.commons.csv.CSVPrinter printer,
                                           org.apache.commons.csv.CSVRecord csvRecord,
                                           int fieldNumber)
                                    throws IOException
        Throws:
        IOException
      • getEntityReference

        protected final EntityReference getEntityReference​(org.apache.commons.csv.CSVPrinter printer,
                                                           org.apache.commons.csv.CSVRecord csvRecord,
                                                           int fieldNumber,
                                                           String entityType)
                                                    throws IOException
        Throws:
        IOException
      • getEntityReference

        protected final EntityReference getEntityReference​(org.apache.commons.csv.CSVPrinter printer,
                                                           org.apache.commons.csv.CSVRecord csvRecord,
                                                           int fieldNumber,
                                                           String entityType,
                                                           String fqn)
                                                    throws IOException
        Throws:
        IOException
      • getEntityReferences

        protected final List<EntityReference> getEntityReferences​(org.apache.commons.csv.CSVPrinter printer,
                                                                  org.apache.commons.csv.CSVRecord csvRecord,
                                                                  int fieldNumber,
                                                                  String entityType)
                                                           throws IOException
        Throws:
        IOException
      • getUserOrTeamEntityReferences

        protected final List<EntityReference> getUserOrTeamEntityReferences​(org.apache.commons.csv.CSVPrinter printer,
                                                                            org.apache.commons.csv.CSVRecord csvRecord,
                                                                            int fieldNumber,
                                                                            String entityType)
                                                                     throws IOException
        Throws:
        IOException
      • getTagLabels

        protected final List<TagLabel> getTagLabels​(org.apache.commons.csv.CSVPrinter printer,
                                                    org.apache.commons.csv.CSVRecord csvRecord,
                                                    int fieldNumber)
                                             throws IOException
        Throws:
        IOException
      • invalidFieldCount

        public static String invalidFieldCount​(int expectedFieldCount,
                                               int actualFieldCount)
      • fieldRequired

        public static String fieldRequired​(int field)
      • invalidField

        public static String invalidField​(int field,
                                          String error)
      • entityNotFound

        public static String entityNotFound​(int field,
                                            String fqn)
      • invalidOwner

        public static String invalidOwner​(int field)
      • invalidBoolean

        public static String invalidBoolean​(int field,
                                            String fieldValue)
      • importFailure

        protected void importFailure​(org.apache.commons.csv.CSVPrinter printer,
                                     String failedReason,
                                     org.apache.commons.csv.CSVRecord inputRecord)
                              throws IOException
        Throws:
        IOException