@Test public void incorrectMultipleSortOrderForMultipleKeysTest() { junitExpectedException.expect(PdfException.class); junitExpectedException.expectMessage(PdfException.NumberOfBooleansInTheArrayDoesntCorrespondWithTheNumberOfFields); final String[] keys = { "testKey1", "testKey2", "testKey3"}; final boolean[] testAscendings = {true, false}; PdfCollectionSort sort = new PdfCollectionSort(keys); sort.setSortOrder(testAscendings); }
public PdfCollectionSort setSortOrder(boolean ascending) { PdfObject obj = getPdfObject().get(PdfName.S); if (obj.isName()) { getPdfObject().put(PdfName.A, PdfBoolean.valueOf(ascending)); } else { throw new PdfException(PdfException.YouHaveToDefineABooleanArrayForThisCollectionSortDictionary); } return this; }
PdfCollectionSort extends PdfObjectWrapper<PdfDictionary> { public PdfCollectionSort setSortOrder(boolean ascending) { PdfObject obj = getPdfObject().get(PdfName.S); if (obj.isName()) { getPdfObject().put(PdfName.A, PdfBoolean.valueOf(ascending)); } else { throw new PdfException(PdfException.YouHaveToDefineABooleanArrayForThisCollectionSortDictionary); } return this; } }
PdfCollectionSort extends PdfObjectWrapper<PdfDictionary> { public PdfCollectionSort setSortOrder(boolean ascending) { PdfObject obj = getPdfObject().get(PdfName.S); if (obj.isName()) { getPdfObject().put(PdfName.A, PdfBoolean.valueOf(ascending)); } else { throw new PdfException(PdfException.YouHaveToDefineABooleanArrayForThisCollectionSortDictionary); } return this; } PdfCollectionSort(PdfDictionary pdfObject);  PdfCollectionSort(String key);  PdfCollectionSort(String[] keys); }
PdfCollectionSort extends PdfObjectWrapper<PdfDictionary> { public PdfCollectionSort setSortOrder(boolean ascending) { PdfObject obj = getPdfObject().get(PdfName.S); if (obj.isName()) { getPdfObject().put(PdfName.A, PdfBoolean.valueOf(ascending)); } else { throw new PdfException(PdfException.YouHaveToDefineABooleanArrayForThisCollectionSortDictionary); } return this; } PdfCollectionSort(PdfDictionary pdfObject);  PdfCollectionSort(String key);  PdfCollectionSort(String[] keys); PdfCollectionSort setSortOrder(boolean ascending); PdfCollectionSort setSortOrder(boolean[] ascending); }
PdfCollectionSort extends PdfObjectWrapper<PdfDictionary> { public PdfCollectionSort setSortOrder(boolean ascending) { PdfObject obj = getPdfObject().get(PdfName.S); if (obj.isName()) { getPdfObject().put(PdfName.A, PdfBoolean.valueOf(ascending)); } else { throw new PdfException(PdfException.YouHaveToDefineABooleanArrayForThisCollectionSortDictionary); } return this; } PdfCollectionSort(PdfDictionary pdfObject);  PdfCollectionSort(String key);  PdfCollectionSort(String[] keys); PdfCollectionSort setSortOrder(boolean ascending); PdfCollectionSort setSortOrder(boolean[] ascending);  }