@Test public void sortOrderForOneKeyTest() { final String key = "testKey"; final boolean testAscending = true; PdfCollectionSort sort = new PdfCollectionSort(key); Assert.assertNull(sort.getPdfObject().get(PdfName.A)); sort.setSortOrder(testAscending); Assert.assertTrue(sort.getPdfObject().getAsBool(PdfName.A)); }
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);  }