TagW implements Serializable { public static Object getValueFromIndex(Object value, int index) { if (value == null || !value.getClass().isArray()) { return value; } if (index >= 0 && index < Array.getLength(value)) { return Array.get(value, index); } return null; } TagW(int id, String keyword, String displayedName, TagType type, int vmMin, int vmMax, Object defaultValue);  TagW(int id, String keyword, TagType type, int vmMin, int vmMax);  TagW(int id, String keyword, String displayedName, TagType type);  TagW(int id, String keyword, TagType type);  TagW(String name, TagType type, int vmMin, int vmMax);  TagW(String keyword, String displayedName, TagType type);  TagW(String keyword, TagType type); int getId(); String getKeyword(); String getDisplayedName(); TagType getType(); int getValueMultiplicity(); boolean isTypeCompliant(Object value); static int getValueMultiplicity(Object value); static Object getValueFromIndex(Object value, int index); @Override String toString(); @Override boolean equals(Object obj); @Override int hashCode(); void readValue(Object data, Tagable tagable); Object getValue(Object data); boolean isStringFamilyType(); synchronized int getAnonymizationType(); synchronized void setAnonymizationType(int anonymizationType); String getFormattedTagValue(Object value, String format); static void addTag(TagW tag); static TagW get(String keyword); static T getTagValue(TagReadable tagable, TagW tag, Class<T> type); static final String NO_VALUE; static final TagW UnknownTag; static final TagW Group; static final TagW PatientPseudoUID; static final TagW SeriesLoading; static final TagW Thumbnail; static final TagW ThumbnailPath; static final TagW ExplorerModel; static final TagW PresentationModel; static final TagW PresentationModelBirary; static final TagW SplitSeriesNumber; static final TagW SeriesSelected; static final TagW SeriesOpen; static final TagW SeriesFocused; static final TagW ImageWidth; static final TagW ImageHeight; static final TagW ImageDepth; static final TagW ImageOrientationPlane; static final TagW ImageBitsPerPixel; static final TagW ImageCache; static final TagW ShutterFinalShape; static final TagW ShutterRGBColor; static final TagW ShutterPSValue; static final TagW OverlayBitMask; static final TagW OverlayBurninDataPath; static final TagW HasOverlay; static final TagW ObjectToSave; static final TagW WadoCompressionRate; static final TagW WadoTransferSyntaxUID; static final TagW DirectDownloadFile; static final TagW DirectDownloadThumbnail; static final TagW ReadFromDicomdir; static final TagW WadoParameters; static final TagW WadoInstanceReferenceList; static final TagW DicomSpecialElementList; static final TagW SlicePosition; static final TagW SuvFactor; static final TagW RootElement; static final TagW FilePath; static final TagW FileName; static final TagW CurrentFolder; static final TagW Checked; static final TagW SubseriesInstanceUID; static final TagW VOILUTsExplanation; static final TagW VOILUTsData; static final TagW ModalityLUTExplanation; static final TagW ModalityLUTType; static final TagW ModalityLUTData; static final TagW PRLUTsExplanation; static final TagW PRLUTsData; static final TagW MonoChrome; }
@Test public void test_getValueFromIndex() throws Exception { assertThat(TagW.getValueFromIndex(null, -1)).isNull(); assertThat(TagW.getValueFromIndex(null, 0)).isNull(); assertThat(TagW.getValueFromIndex(null, 1)).isNull(); assertThat(TagW.getValueFromIndex(STRING_VALUE_1, -1)).isEqualTo(STRING_VALUE_1); assertThat(TagW.getValueFromIndex(STRING_VALUE_1, 0)).isEqualTo(STRING_VALUE_1); assertThat(TagW.getValueFromIndex(STRING_VALUE_1, 1)).isEqualTo(STRING_VALUE_1); assertThat(TagW.getValueFromIndex(STRING_ARRAY, -1)).isNull(); assertThat(TagW.getValueFromIndex(STRING_ARRAY, 0)).isEqualTo(STRING_ARRAY[0]); assertThat(TagW.getValueFromIndex(STRING_ARRAY, 1)).isEqualTo(STRING_ARRAY[1]); assertThat(TagW.getValueFromIndex(STRING_ARRAY, 2)).isNull(); }