public class CorrectionDocumentUtils extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_RECORD_COUNT_FUNCTIONALITY_LIMIT |
static int |
DEFAULT_RECORDS_PER_PAGE |
static int |
RECORD_COUNT_FUNCTIONALITY_LIMIT_IS_NONE
The GLCP document will always be on restricted functionality mode, regardless of input group size
|
static int |
RECORD_COUNT_FUNCTIONALITY_LIMIT_IS_UNLIMITED
The GLCP document will never be on restricted functionality mode, regardless of input group size
|
Constructor and Description |
---|
CorrectionDocumentUtils() |
Modifier and Type | Method and Description |
---|---|
static OriginEntryFull |
applyCriteriaToEntry(OriginEntryFull entry,
boolean matchCriteriaOnly,
List<CorrectionChangeGroup> changeCriteriaGroups)
Applies a list of change criteria groups to an origin entry.
|
static boolean |
compareStringData(CorrectionCriteria cc,
String fieldTestValue,
String fieldActualValueString)
Compares string data
|
static boolean |
compareTo(int compareTo,
String operatorCode)
Returns true is compared indicator matches
|
static String |
convertToString(Object fieldActualValue,
String fieldType)
Converts the value into a string, with the appropriate formatting
|
static void |
copyStatisticsToDocument(OriginEntryStatistics statistics,
GeneralLedgerCorrectionProcessDocument document)
Sets document with the statistics data
|
static boolean |
doesEntryMatchAnyCriteriaGroups(OriginEntryFull entry,
Collection<CorrectionChangeGroup> groups)
Returns whether the entry matches any of the criteria groups
|
static boolean |
entryMatchesCriteria(CorrectionCriteria cc,
OriginEntryFull oe)
Returns whether an origin entry matches the passed in criteria.
|
static int |
getRecordCountFunctionalityLimit()
This method returns the limit for record count functionality
|
static int |
getRecordsPerPage()
This method returns the number of records per page
|
static OriginEntryStatistics |
getStatistics(Collection<OriginEntryFull> entries)
Computes the statistics (credit amount, debit amount, row count) of a collection of origin entries.
|
static boolean |
isBudget(OriginEntryFull oe)
Returns whether the origin entry represents a budget
|
static boolean |
isCredit(OriginEntryFull oe)
Returns whether the origin entry represents a credit
|
static boolean |
isDebit(OriginEntryFull oe)
Returns whether the origin entry represents a debit
|
static boolean |
isRestrictedFunctionalityMode(int inputGroupSize,
int recordCountFunctionalityLimit)
This method returns true if input group size is greater than or equal to record count functionality limit
|
static void |
setAllEntryIdsToNull(Collection<OriginEntryFull> originEntries)
Sets all origin entries' entry IDs to null within the collection.
|
static void |
setSequentialEntryIds(Collection<OriginEntryFull> originEntries)
Sets all origin entries' entry IDs to be sequential starting from 0 in the collection
|
static void |
updateStatisticsWithEntry(OriginEntryFull entry,
OriginEntryStatistics statistics)
Given an instance of statistics, it adds information from the passed in entry to the statistics
|
static boolean |
validCorrectionChangeForAdding(CorrectionChange correctionChange)
When a correction change is about to be added to a group, this will check if it is valid, meaning that the field name is not
blank
|
static boolean |
validCorrectionChangeForSaving(CorrectionChange correctionChange)
When a document is about to be saved, this will check if it is valid, meaning that the field name and value are both blank
|
static boolean |
validCorrectionCriteriaForAdding(CorrectionCriteria correctionCriteria)
When a correction criterion is about to be added to a group, this will check if it is valid, meaning that the field name is
not blank
|
static boolean |
validCorrectionCriteriaForSaving(CorrectionCriteria correctionCriteria)
When a document is about to be saved, this will check if it is valid, meaning that the field name and value are both blank
|
public static final int DEFAULT_RECORD_COUNT_FUNCTIONALITY_LIMIT
public static final int RECORD_COUNT_FUNCTIONALITY_LIMIT_IS_NONE
public static final int RECORD_COUNT_FUNCTIONALITY_LIMIT_IS_UNLIMITED
public static final int DEFAULT_RECORDS_PER_PAGE
public CorrectionDocumentUtils()
public static int getRecordCountFunctionalityLimit()
public static int getRecordsPerPage()
public static boolean isRestrictedFunctionalityMode(int inputGroupSize, int recordCountFunctionalityLimit)
inputGroupSize
- size of input groupsrecordCountFunctionalityLimit
- limit for record count functionalitypublic static boolean validCorrectionCriteriaForAdding(CorrectionCriteria correctionCriteria)
correctionCriteria
- validated correction criteriapublic static boolean validCorrectionCriteriaForSaving(CorrectionCriteria correctionCriteria)
correctionCriteria
- validated correction criteriapublic static boolean validCorrectionChangeForAdding(CorrectionChange correctionChange)
correctionChange
- validated correction changepublic static boolean validCorrectionChangeForSaving(CorrectionChange correctionChange)
correctionCriteria
- validated correction criteriapublic static void setAllEntryIdsToNull(Collection<OriginEntryFull> originEntries)
originEntries
- collection of origin entriespublic static void setSequentialEntryIds(Collection<OriginEntryFull> originEntries)
originEntries
- collection of origin entriespublic static boolean entryMatchesCriteria(CorrectionCriteria cc, OriginEntryFull oe)
cc
- correction criteria to test against origin entryoe
- origin entry to testpublic static boolean compareStringData(CorrectionCriteria cc, String fieldTestValue, String fieldActualValueString)
cc
- criteriafieldTestValue
- test valuefieldActualValueString
- actual valuepublic static boolean compareTo(int compareTo, String operatorCode)
compareTo
- operatorCode
- public static String convertToString(Object fieldActualValue, String fieldType)
fieldActualValue
- actual field valuefieldType
- field type (i.e. "String", "Integer", "Date")public static OriginEntryFull applyCriteriaToEntry(OriginEntryFull entry, boolean matchCriteriaOnly, List<CorrectionChangeGroup> changeCriteriaGroups)
entry
- origin entrymatchCriteriaOnly
- if true and no criteria match, then this method will return nullchangeCriteriaGroups
- list of change criteria groups to applypublic static boolean doesEntryMatchAnyCriteriaGroups(OriginEntryFull entry, Collection<CorrectionChangeGroup> groups)
entry
- origin entrygroups
- collection of correction change grouppublic static OriginEntryStatistics getStatistics(Collection<OriginEntryFull> entries)
entries
- list of orgin entry entriesOriginEntryStatistics
statistics (credit amount, debit amount, row count) of a collection of origin entries.public static boolean isDebit(OriginEntryFull oe)
oe
- origin entrypublic static boolean isBudget(OriginEntryFull oe)
oe
- origin entrypublic static boolean isCredit(OriginEntryFull oe)
oe
- origin entrypublic static void updateStatisticsWithEntry(OriginEntryFull entry, OriginEntryStatistics statistics)
entry
- origin entrystatistics
- adds statistics from the passed in origin entry to the passed in statisticspublic static void copyStatisticsToDocument(OriginEntryStatistics statistics, GeneralLedgerCorrectionProcessDocument document)
statistics
- origin entry statistics that are being used to set documentdocument
- document with statistic information being setCopyright © 2004–2015 The Kuali Foundation. All rights reserved.