target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testMerge() throws Exception { try { config.removeDevice("Test-Device-1", null); } catch (ConfigurationNotFoundException e) {} Device device = createDevice("Test-Device-1", "TEST-AET1"); config.persist(device, null); modifyDevice(device); config.merge(device, null); ApplicationEntity ae2 = config.find...
@Override public ConfigurationChanges merge(Device device, EnumSet<Option> options) throws ConfigurationException { ConfigurationChanges diffs = configurationChangesOf(options); merge(device, options, diffs); return diffs; }
LdapDicomConfiguration implements DicomConfiguration { @Override public ConfigurationChanges merge(Device device, EnumSet<Option> options) throws ConfigurationException { ConfigurationChanges diffs = configurationChangesOf(options); merge(device, options, diffs); return diffs; } }
LdapDicomConfiguration implements DicomConfiguration { @Override public ConfigurationChanges merge(Device device, EnumSet<Option> options) throws ConfigurationException { ConfigurationChanges diffs = configurationChangesOf(options); merge(device, options, diffs); return diffs; } LdapDicomConfiguration(); @SuppressWarni...
LdapDicomConfiguration implements DicomConfiguration { @Override public ConfigurationChanges merge(Device device, EnumSet<Option> options) throws ConfigurationException { ConfigurationChanges diffs = configurationChangesOf(options); merge(device, options, diffs); return diffs; } LdapDicomConfiguration(); @SuppressWarni...
LdapDicomConfiguration implements DicomConfiguration { @Override public ConfigurationChanges merge(Device device, EnumSet<Option> options) throws ConfigurationException { ConfigurationChanges diffs = configurationChangesOf(options); merge(device, options, diffs); return diffs; } LdapDicomConfiguration(); @SuppressWarni...
@Test public void testParseTMacrnema() { DatePrecision precision = new DatePrecision(); assertEquals(0, DateUtils.parseTM(tz, "02:00:00", precision).getTime()); assertEquals(Calendar.SECOND, precision.lastField); }
public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); }
DateUtils { public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); } }
DateUtils { public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); } }
DateUtils { public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date)...
DateUtils { public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date)...
@Test public void testParseTMceil() { DatePrecision precision = new DatePrecision(); assertEquals(MINUTE - 1, DateUtils.parseTM(tz, "0200", true, precision).getTime()); assertEquals(Calendar.MINUTE, precision.lastField); }
public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); }
DateUtils { public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); } }
DateUtils { public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); } }
DateUtils { public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date)...
DateUtils { public static Date parseTM(TimeZone tz, String s, DatePrecision precision) { return parseTM(tz, s, false, precision); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date)...
@Test public void testParseDT() { DatePrecision precision = new DatePrecision(); assertEquals(0, DateUtils.parseDT(tz, "19700101020000.000", precision).getTime()); assertEquals(Calendar.MILLISECOND, precision.lastField); assertFalse(precision.includeTimezone); }
public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); }
DateUtils { public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); } }
DateUtils { public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); } }
DateUtils { public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date)...
DateUtils { public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date)...
@Test public void testParseWithTZ() { DatePrecision precision = new DatePrecision(); assertEquals(2 * HOUR, DateUtils.parseDT(tz, "19700101020000.000+0000", precision).getTime()); assertEquals(Calendar.MILLISECOND, precision.lastField); assertTrue(precision.includeTimezone); }
public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); }
DateUtils { public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); } }
DateUtils { public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); } }
DateUtils { public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date)...
DateUtils { public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date)...
@Test public void testParseDTceil() { DatePrecision precision = new DatePrecision(); assertEquals(YEAR - 2 * HOUR - 1, DateUtils.parseDT(tz, "1970", true, precision).getTime()); assertEquals(Calendar.YEAR, precision.lastField); assertFalse(precision.includeTimezone); }
public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); }
DateUtils { public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); } }
DateUtils { public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); } }
DateUtils { public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date)...
DateUtils { public static Date parseDT(TimeZone tz, String s, DatePrecision precision) { return parseDT(tz, s, false, precision); } static String formatDA(TimeZone tz, Date date); static StringBuilder formatDA(TimeZone tz, Date date, StringBuilder toAppendTo); static String formatTM(TimeZone tz, Date date)...
@Test public void testSize() { assertEquals(15, map.size()); removeOdd(); assertEquals(7, map.size()); }
public int size() { return size; }
IntHashMap implements Cloneable, java.io.Serializable { public int size() { return size; } }
IntHashMap implements Cloneable, java.io.Serializable { public int size() { return size; } IntHashMap(); IntHashMap(int expectedMaxSize); }
IntHashMap implements Cloneable, java.io.Serializable { public int size() { return size; } IntHashMap(); IntHashMap(int expectedMaxSize); int size(); boolean isEmpty(); @SuppressWarnings("unchecked") V get(int key); boolean containsKey(int key); @SuppressWarnings("unchecked") V put(int key, V value); void trimToSize()...
IntHashMap implements Cloneable, java.io.Serializable { public int size() { return size; } IntHashMap(); IntHashMap(int expectedMaxSize); int size(); boolean isEmpty(); @SuppressWarnings("unchecked") V get(int key); boolean containsKey(int key); @SuppressWarnings("unchecked") V put(int key, V value); void trimToSize()...
@Test public void testGet() { removeOdd(); testGet(map); }
@SuppressWarnings("unchecked") public V get(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) return (V) values[i]; i = (i + 1) & mask; } return null; }
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public V get(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) return (V) values[i]; i = (i + 1) & mask; } return null; } }
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public V get(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) return (V) values[i]; i = (i + 1) & mask; } return null; } I...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public V get(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) return (V) values[i]; i = (i + 1) & mask; } return null; } I...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public V get(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) return (V) values[i]; i = (i + 1) & mask; } return null; } I...
@Test public void testPut() { removeOdd(); for (int i = 0; i < 45; i++) map.put(i, Integer.valueOf(i)); assertEquals(45, map.size()); for (int i = 0; i < 45; i++) assertEquals(Integer.valueOf(i), map.get(i)); }
@SuppressWarnings("unchecked") public V put(int key, V value) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] > FREE) { if (keys[i] == key) { V oldValue = (V) values[i]; values[i] = value; return oldValue; } i = (i + 1) & mask; } byte oldState = st...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public V put(int key, V value) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] > FREE) { if (keys[i] == key) { V oldValue = (V) values[i]; values[i] = value; ret...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public V put(int key, V value) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] > FREE) { if (keys[i] == key) { V oldValue = (V) values[i]; values[i] = value; ret...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public V put(int key, V value) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] > FREE) { if (keys[i] == key) { V oldValue = (V) values[i]; values[i] = value; ret...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public V put(int key, V value) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] > FREE) { if (keys[i] == key) { V oldValue = (V) values[i]; values[i] = value; ret...
@Test public void testContainsKey() { removeOdd(); for (int i = 1; i < 45; i++) assertEquals((i & 1) == 0 && (i % 3) == 1, map.containsKey(i)); }
public boolean containsKey(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) return states[i] > FREE; i = (i + 1) & mask; } return false; }
IntHashMap implements Cloneable, java.io.Serializable { public boolean containsKey(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) return states[i] > FREE; i = (i + 1) & mask; } return false; } }
IntHashMap implements Cloneable, java.io.Serializable { public boolean containsKey(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) return states[i] > FREE; i = (i + 1) & mask; } return false; } IntHashMap(); ...
IntHashMap implements Cloneable, java.io.Serializable { public boolean containsKey(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) return states[i] > FREE; i = (i + 1) & mask; } return false; } IntHashMap(); ...
IntHashMap implements Cloneable, java.io.Serializable { public boolean containsKey(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) return states[i] > FREE; i = (i + 1) & mask; } return false; } IntHashMap(); ...
@Test public void testRehash() { removeOdd(); map.trimToSize(); testGet(map); }
public void rehash() { resize(keys.length); }
IntHashMap implements Cloneable, java.io.Serializable { public void rehash() { resize(keys.length); } }
IntHashMap implements Cloneable, java.io.Serializable { public void rehash() { resize(keys.length); } IntHashMap(); IntHashMap(int expectedMaxSize); }
IntHashMap implements Cloneable, java.io.Serializable { public void rehash() { resize(keys.length); } IntHashMap(); IntHashMap(int expectedMaxSize); int size(); boolean isEmpty(); @SuppressWarnings("unchecked") V get(int key); boolean containsKey(int key); @SuppressWarnings("unchecked") V put(int key, V value); void t...
IntHashMap implements Cloneable, java.io.Serializable { public void rehash() { resize(keys.length); } IntHashMap(); IntHashMap(int expectedMaxSize); int size(); boolean isEmpty(); @SuppressWarnings("unchecked") V get(int key); boolean containsKey(int key); @SuppressWarnings("unchecked") V put(int key, V value); void t...
@Test public void testWriteTo() throws Exception { StringWriter writer = new StringWriter(); try ( JsonGenerator gen = Json.createGenerator(writer)) { JsonConfiguration config = new JsonConfiguration(); config.addJsonConfigurationExtension(new JsonAuditLoggerConfiguration()); config.addJsonConfigurationExtension(new Js...
public void writeTo(DeviceInfo deviceInfo, JsonGenerator gen) { JsonWriter writer = new JsonWriter(gen); gen.writeStartObject(); gen.write("dicomDeviceName", deviceInfo.getDeviceName()); writer.writeNotNullOrDef("dicomDescription", deviceInfo.getDescription(), null); writer.writeNotNullOrDef("dicomManufacturer", device...
JsonConfiguration { public void writeTo(DeviceInfo deviceInfo, JsonGenerator gen) { JsonWriter writer = new JsonWriter(gen); gen.writeStartObject(); gen.write("dicomDeviceName", deviceInfo.getDeviceName()); writer.writeNotNullOrDef("dicomDescription", deviceInfo.getDescription(), null); writer.writeNotNullOrDef("dicomM...
JsonConfiguration { public void writeTo(DeviceInfo deviceInfo, JsonGenerator gen) { JsonWriter writer = new JsonWriter(gen); gen.writeStartObject(); gen.write("dicomDeviceName", deviceInfo.getDeviceName()); writer.writeNotNullOrDef("dicomDescription", deviceInfo.getDescription(), null); writer.writeNotNullOrDef("dicomM...
JsonConfiguration { public void writeTo(DeviceInfo deviceInfo, JsonGenerator gen) { JsonWriter writer = new JsonWriter(gen); gen.writeStartObject(); gen.write("dicomDeviceName", deviceInfo.getDeviceName()); writer.writeNotNullOrDef("dicomDescription", deviceInfo.getDescription(), null); writer.writeNotNullOrDef("dicomM...
JsonConfiguration { public void writeTo(DeviceInfo deviceInfo, JsonGenerator gen) { JsonWriter writer = new JsonWriter(gen); gen.writeStartObject(); gen.write("dicomDeviceName", deviceInfo.getDeviceName()); writer.writeNotNullOrDef("dicomDescription", deviceInfo.getDescription(), null); writer.writeNotNullOrDef("dicomM...
@Test public void testRemove() { for (int i = 1; i < 45; i += 2) if ((i % 3) == 1) assertEquals(Integer.valueOf(i), map.remove(i)); else assertNull(map.remove(i)); }
@SuppressWarnings("unchecked") public V remove(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) { if (states[i] < FREE) return null; states[i] = REMOVED; V oldValue = (V) values[i]; values[i] = null; size--; r...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public V remove(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) { if (states[i] < FREE) return null; states[i] = REMOVED;...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public V remove(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) { if (states[i] < FREE) return null; states[i] = REMOVED;...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public V remove(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) { if (states[i] < FREE) return null; states[i] = REMOVED;...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public V remove(int key) { byte[] states = this.states; int[] keys = this.keys; int mask = keys.length - 1; int i = key & mask; while (states[i] != FREE) { if (keys[i] == key) { if (states[i] < FREE) return null; states[i] = REMOVED;...
@Test public void testClear() { assertFalse(map.isEmpty()); map.clear(); assertTrue(map.isEmpty()); }
public void clear() { Arrays.fill(values, null); Arrays.fill(states, FREE); size = 0; free = keys.length >>> 1; }
IntHashMap implements Cloneable, java.io.Serializable { public void clear() { Arrays.fill(values, null); Arrays.fill(states, FREE); size = 0; free = keys.length >>> 1; } }
IntHashMap implements Cloneable, java.io.Serializable { public void clear() { Arrays.fill(values, null); Arrays.fill(states, FREE); size = 0; free = keys.length >>> 1; } IntHashMap(); IntHashMap(int expectedMaxSize); }
IntHashMap implements Cloneable, java.io.Serializable { public void clear() { Arrays.fill(values, null); Arrays.fill(states, FREE); size = 0; free = keys.length >>> 1; } IntHashMap(); IntHashMap(int expectedMaxSize); int size(); boolean isEmpty(); @SuppressWarnings("unchecked") V get(int key); boolean containsKey(int ...
IntHashMap implements Cloneable, java.io.Serializable { public void clear() { Arrays.fill(values, null); Arrays.fill(states, FREE); size = 0; free = keys.length >>> 1; } IntHashMap(); IntHashMap(int expectedMaxSize); int size(); boolean isEmpty(); @SuppressWarnings("unchecked") V get(int key); boolean containsKey(int ...
@SuppressWarnings("unchecked") @Test public void testClone() { removeOdd(); IntHashMap<Integer> clone = (IntHashMap<Integer>) map.clone(); map.clear(); testGet(clone); }
@SuppressWarnings("unchecked") public Object clone() { try { IntHashMap<V> m = (IntHashMap<V>) super.clone(); m.states = states.clone(); m.keys = keys.clone(); m.values = values.clone(); return m; } catch (CloneNotSupportedException e) { throw new InternalError(); } }
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public Object clone() { try { IntHashMap<V> m = (IntHashMap<V>) super.clone(); m.states = states.clone(); m.keys = keys.clone(); m.values = values.clone(); return m; } catch (CloneNotSupportedException e) { throw new InternalError();...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public Object clone() { try { IntHashMap<V> m = (IntHashMap<V>) super.clone(); m.states = states.clone(); m.keys = keys.clone(); m.values = values.clone(); return m; } catch (CloneNotSupportedException e) { throw new InternalError();...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public Object clone() { try { IntHashMap<V> m = (IntHashMap<V>) super.clone(); m.states = states.clone(); m.keys = keys.clone(); m.values = values.clone(); return m; } catch (CloneNotSupportedException e) { throw new InternalError();...
IntHashMap implements Cloneable, java.io.Serializable { @SuppressWarnings("unchecked") public Object clone() { try { IntHashMap<V> m = (IntHashMap<V>) super.clone(); m.states = states.clone(); m.keys = keys.clone(); m.values = values.clone(); return m; } catch (CloneNotSupportedException e) { throw new InternalError();...
@Test public void testBytesToUShortBE() { assertEquals(-12345 & 0xffff, ByteUtils.bytesToUShortBE(SHORT_12345_BE, 0)); }
public static int bytesToUShortBE(byte[] bytes, int off) { return ((bytes[off] & 255) << 8) + (bytes[off + 1] & 255); }
ByteUtils { public static int bytesToUShortBE(byte[] bytes, int off) { return ((bytes[off] & 255) << 8) + (bytes[off + 1] & 255); } }
ByteUtils { public static int bytesToUShortBE(byte[] bytes, int off) { return ((bytes[off] & 255) << 8) + (bytes[off + 1] & 255); } }
ByteUtils { public static int bytesToUShortBE(byte[] bytes, int off) { return ((bytes[off] & 255) << 8) + (bytes[off + 1] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShor...
ByteUtils { public static int bytesToUShortBE(byte[] bytes, int off) { return ((bytes[off] & 255) << 8) + (bytes[off + 1] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShor...
@Test public void testBytesToUShortLE() { assertEquals(-12345 & 0xffff, ByteUtils.bytesToUShortLE(SHORT_12345_LE, 0)); }
public static int bytesToUShortLE(byte[] bytes, int off) { return ((bytes[off + 1] & 255) << 8) + (bytes[off] & 255); }
ByteUtils { public static int bytesToUShortLE(byte[] bytes, int off) { return ((bytes[off + 1] & 255) << 8) + (bytes[off] & 255); } }
ByteUtils { public static int bytesToUShortLE(byte[] bytes, int off) { return ((bytes[off + 1] & 255) << 8) + (bytes[off] & 255); } }
ByteUtils { public static int bytesToUShortLE(byte[] bytes, int off) { return ((bytes[off + 1] & 255) << 8) + (bytes[off] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShor...
ByteUtils { public static int bytesToUShortLE(byte[] bytes, int off) { return ((bytes[off + 1] & 255) << 8) + (bytes[off] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShor...
@Test public void testBytesToShortBE() { assertEquals(-12345, ByteUtils.bytesToShortBE(SHORT_12345_BE, 0)); }
public static int bytesToShortBE(byte[] bytes, int off) { return (bytes[off] << 8) + (bytes[off + 1] & 255); }
ByteUtils { public static int bytesToShortBE(byte[] bytes, int off) { return (bytes[off] << 8) + (bytes[off + 1] & 255); } }
ByteUtils { public static int bytesToShortBE(byte[] bytes, int off) { return (bytes[off] << 8) + (bytes[off + 1] & 255); } }
ByteUtils { public static int bytesToShortBE(byte[] bytes, int off) { return (bytes[off] << 8) + (bytes[off + 1] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[...
ByteUtils { public static int bytesToShortBE(byte[] bytes, int off) { return (bytes[off] << 8) + (bytes[off + 1] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[...
@Test public void testBytesToShortLE() { assertEquals(-12345, ByteUtils.bytesToShortLE(SHORT_12345_LE, 0)); }
public static int bytesToShortLE(byte[] bytes, int off) { return (bytes[off + 1] << 8) + (bytes[off] & 255); }
ByteUtils { public static int bytesToShortLE(byte[] bytes, int off) { return (bytes[off + 1] << 8) + (bytes[off] & 255); } }
ByteUtils { public static int bytesToShortLE(byte[] bytes, int off) { return (bytes[off + 1] << 8) + (bytes[off] & 255); } }
ByteUtils { public static int bytesToShortLE(byte[] bytes, int off) { return (bytes[off + 1] << 8) + (bytes[off] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[...
ByteUtils { public static int bytesToShortLE(byte[] bytes, int off) { return (bytes[off + 1] << 8) + (bytes[off] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[...
@Test public void testBytesToIntBE() { assertEquals(-12345, ByteUtils.bytesToIntBE(INT_12345_BE, 0)); }
public static int bytesToIntBE(byte[] bytes, int off) { return (bytes[off] << 24) + ((bytes[off + 1] & 255) << 16) + ((bytes[off + 2] & 255) << 8) + (bytes[off + 3] & 255); }
ByteUtils { public static int bytesToIntBE(byte[] bytes, int off) { return (bytes[off] << 24) + ((bytes[off + 1] & 255) << 16) + ((bytes[off + 2] & 255) << 8) + (bytes[off + 3] & 255); } }
ByteUtils { public static int bytesToIntBE(byte[] bytes, int off) { return (bytes[off] << 24) + ((bytes[off + 1] & 255) << 16) + ((bytes[off + 2] & 255) << 8) + (bytes[off + 3] & 255); } }
ByteUtils { public static int bytesToIntBE(byte[] bytes, int off) { return (bytes[off] << 24) + ((bytes[off + 1] & 255) << 16) + ((bytes[off + 2] & 255) << 8) + (bytes[off + 3] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToU...
ByteUtils { public static int bytesToIntBE(byte[] bytes, int off) { return (bytes[off] << 24) + ((bytes[off + 1] & 255) << 16) + ((bytes[off + 2] & 255) << 8) + (bytes[off + 3] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToU...
@Test public void testBytesToIntLE() { assertEquals(-12345, ByteUtils.bytesToIntLE(INT_12345_LE, 0)); }
public static int bytesToIntLE(byte[] bytes, int off) { return (bytes[off + 3] << 24) + ((bytes[off + 2] & 255) << 16) + ((bytes[off + 1] & 255) << 8) + (bytes[off] & 255); }
ByteUtils { public static int bytesToIntLE(byte[] bytes, int off) { return (bytes[off + 3] << 24) + ((bytes[off + 2] & 255) << 16) + ((bytes[off + 1] & 255) << 8) + (bytes[off] & 255); } }
ByteUtils { public static int bytesToIntLE(byte[] bytes, int off) { return (bytes[off + 3] << 24) + ((bytes[off + 2] & 255) << 16) + ((bytes[off + 1] & 255) << 8) + (bytes[off] & 255); } }
ByteUtils { public static int bytesToIntLE(byte[] bytes, int off) { return (bytes[off + 3] << 24) + ((bytes[off + 2] & 255) << 16) + ((bytes[off + 1] & 255) << 8) + (bytes[off] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToU...
ByteUtils { public static int bytesToIntLE(byte[] bytes, int off) { return (bytes[off + 3] << 24) + ((bytes[off + 2] & 255) << 16) + ((bytes[off + 1] & 255) << 8) + (bytes[off] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToU...
@Test public void testBytesToTagBE() { assertEquals(Tag.PixelData, ByteUtils.bytesToTagBE(TAG_PIXEL_DATA_BE, 0)); }
public static int bytesToTagBE(byte[] bytes, int off) { return bytesToIntBE(bytes, off); }
ByteUtils { public static int bytesToTagBE(byte[] bytes, int off) { return bytesToIntBE(bytes, off); } }
ByteUtils { public static int bytesToTagBE(byte[] bytes, int off) { return bytesToIntBE(bytes, off); } }
ByteUtils { public static int bytesToTagBE(byte[] bytes, int off) { return bytesToIntBE(bytes, off); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); s...
ByteUtils { public static int bytesToTagBE(byte[] bytes, int off) { return bytesToIntBE(bytes, off); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes, int off); s...
@Test public void testToString() { ItemPointer ip = new ItemPointer(Tag.RequestAttributesSequence); AttributeSelector selector = new AttributeSelector(Tag.StudyInstanceUID, null, ip); assertEquals(XPATH, selector.toString()); }
@Override public String toString() { if (str == null) str = toStringBuilder().toString(); return str; }
AttributeSelector implements Serializable { @Override public String toString() { if (str == null) str = toStringBuilder().toString(); return str; } }
AttributeSelector implements Serializable { @Override public String toString() { if (str == null) str = toStringBuilder().toString(); return str; } AttributeSelector(int tag); AttributeSelector(int tag, String privateCreator); AttributeSelector(int tag, String privateCreator, ItemPointer... itemPointers); AttributeS...
AttributeSelector implements Serializable { @Override public String toString() { if (str == null) str = toStringBuilder().toString(); return str; } AttributeSelector(int tag); AttributeSelector(int tag, String privateCreator); AttributeSelector(int tag, String privateCreator, ItemPointer... itemPointers); AttributeS...
AttributeSelector implements Serializable { @Override public String toString() { if (str == null) str = toStringBuilder().toString(); return str; } AttributeSelector(int tag); AttributeSelector(int tag, String privateCreator); AttributeSelector(int tag, String privateCreator, ItemPointer... itemPointers); AttributeS...
@Test public void testBytesToTagLE() { assertEquals(Tag.PixelData, ByteUtils.bytesToTagLE(TAG_PIXEL_DATA_LE, 0)); }
public static int bytesToTagLE(byte[] bytes, int off) { return (bytes[off + 1] << 24) + ((bytes[off] & 255) << 16) + ((bytes[off + 3] & 255) << 8) + (bytes[off + 2] & 255); }
ByteUtils { public static int bytesToTagLE(byte[] bytes, int off) { return (bytes[off + 1] << 24) + ((bytes[off] & 255) << 16) + ((bytes[off + 3] & 255) << 8) + (bytes[off + 2] & 255); } }
ByteUtils { public static int bytesToTagLE(byte[] bytes, int off) { return (bytes[off + 1] << 24) + ((bytes[off] & 255) << 16) + ((bytes[off + 3] & 255) << 8) + (bytes[off + 2] & 255); } }
ByteUtils { public static int bytesToTagLE(byte[] bytes, int off) { return (bytes[off + 1] << 24) + ((bytes[off] & 255) << 16) + ((bytes[off + 3] & 255) << 8) + (bytes[off + 2] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToU...
ByteUtils { public static int bytesToTagLE(byte[] bytes, int off) { return (bytes[off + 1] << 24) + ((bytes[off] & 255) << 16) + ((bytes[off + 3] & 255) << 8) + (bytes[off + 2] & 255); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToU...
@Test public void testBytesToFloatBE() { assertEquals((float) Math.PI, ByteUtils.bytesToFloatBE(FLOAT_PI_BE, 0), 0); }
public static float bytesToFloatBE(byte[] bytes, int off) { return Float.intBitsToFloat(bytesToIntBE(bytes, off)); }
ByteUtils { public static float bytesToFloatBE(byte[] bytes, int off) { return Float.intBitsToFloat(bytesToIntBE(bytes, off)); } }
ByteUtils { public static float bytesToFloatBE(byte[] bytes, int off) { return Float.intBitsToFloat(bytesToIntBE(bytes, off)); } }
ByteUtils { public static float bytesToFloatBE(byte[] bytes, int off) { return Float.intBitsToFloat(bytesToIntBE(bytes, off)); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE...
ByteUtils { public static float bytesToFloatBE(byte[] bytes, int off) { return Float.intBitsToFloat(bytesToIntBE(bytes, off)); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE...
@Test public void testBytesToFloatLE() { assertEquals((float) Math.PI, ByteUtils.bytesToFloatLE(FLOAT_PI_LE, 0), 0); }
public static float bytesToFloatLE(byte[] bytes, int off) { return Float.intBitsToFloat(bytesToIntLE(bytes, off)); }
ByteUtils { public static float bytesToFloatLE(byte[] bytes, int off) { return Float.intBitsToFloat(bytesToIntLE(bytes, off)); } }
ByteUtils { public static float bytesToFloatLE(byte[] bytes, int off) { return Float.intBitsToFloat(bytesToIntLE(bytes, off)); } }
ByteUtils { public static float bytesToFloatLE(byte[] bytes, int off) { return Float.intBitsToFloat(bytesToIntLE(bytes, off)); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE...
ByteUtils { public static float bytesToFloatLE(byte[] bytes, int off) { return Float.intBitsToFloat(bytesToIntLE(bytes, off)); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE...
@Test public void testBytesToDoubleBE() { assertEquals(Math.PI, ByteUtils.bytesToDoubleBE(DOUBLE_PI_BE, 0), 0); }
public static double bytesToDoubleBE(byte[] bytes, int off) { return Double.longBitsToDouble(bytesToLongBE(bytes, off)); }
ByteUtils { public static double bytesToDoubleBE(byte[] bytes, int off) { return Double.longBitsToDouble(bytesToLongBE(bytes, off)); } }
ByteUtils { public static double bytesToDoubleBE(byte[] bytes, int off) { return Double.longBitsToDouble(bytesToLongBE(bytes, off)); } }
ByteUtils { public static double bytesToDoubleBE(byte[] bytes, int off) { return Double.longBitsToDouble(bytesToLongBE(bytes, off)); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUS...
ByteUtils { public static double bytesToDoubleBE(byte[] bytes, int off) { return Double.longBitsToDouble(bytesToLongBE(bytes, off)); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUS...
@Test public void testBytesToDoubleLE() { assertEquals(Math.PI, ByteUtils.bytesToDoubleLE(DOUBLE_PI_LE, 0), 0); }
public static double bytesToDoubleLE(byte[] bytes, int off) { return Double.longBitsToDouble(bytesToLongLE(bytes, off)); }
ByteUtils { public static double bytesToDoubleLE(byte[] bytes, int off) { return Double.longBitsToDouble(bytesToLongLE(bytes, off)); } }
ByteUtils { public static double bytesToDoubleLE(byte[] bytes, int off) { return Double.longBitsToDouble(bytesToLongLE(bytes, off)); } }
ByteUtils { public static double bytesToDoubleLE(byte[] bytes, int off) { return Double.longBitsToDouble(bytesToLongLE(bytes, off)); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUS...
ByteUtils { public static double bytesToDoubleLE(byte[] bytes, int off) { return Double.longBitsToDouble(bytesToLongLE(bytes, off)); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUS...
@Test public void testShortToBytesBE() { assertArrayEquals(SHORT_12345_BE, ByteUtils.shortToBytesBE(-12345, new byte[2] , 0)); }
public static byte[] shortToBytesBE(int i, byte[] bytes, int off) { bytes[off] = (byte) (i >> 8); bytes[off + 1] = (byte) i; return bytes; }
ByteUtils { public static byte[] shortToBytesBE(int i, byte[] bytes, int off) { bytes[off] = (byte) (i >> 8); bytes[off + 1] = (byte) i; return bytes; } }
ByteUtils { public static byte[] shortToBytesBE(int i, byte[] bytes, int off) { bytes[off] = (byte) (i >> 8); bytes[off + 1] = (byte) i; return bytes; } }
ByteUtils { public static byte[] shortToBytesBE(int i, byte[] bytes, int off) { bytes[off] = (byte) (i >> 8); bytes[off + 1] = (byte) i; return bytes; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); st...
ByteUtils { public static byte[] shortToBytesBE(int i, byte[] bytes, int off) { bytes[off] = (byte) (i >> 8); bytes[off + 1] = (byte) i; return bytes; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); st...
@Test public void testShortToBytesLE() { assertArrayEquals(SHORT_12345_LE, ByteUtils.shortToBytesLE(-12345, new byte[2] , 0)); }
public static byte[] shortToBytesLE(int i, byte[] bytes, int off) { bytes[off + 1] = (byte) (i >> 8); bytes[off] = (byte) i; return bytes; }
ByteUtils { public static byte[] shortToBytesLE(int i, byte[] bytes, int off) { bytes[off + 1] = (byte) (i >> 8); bytes[off] = (byte) i; return bytes; } }
ByteUtils { public static byte[] shortToBytesLE(int i, byte[] bytes, int off) { bytes[off + 1] = (byte) (i >> 8); bytes[off] = (byte) i; return bytes; } }
ByteUtils { public static byte[] shortToBytesLE(int i, byte[] bytes, int off) { bytes[off + 1] = (byte) (i >> 8); bytes[off] = (byte) i; return bytes; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); st...
ByteUtils { public static byte[] shortToBytesLE(int i, byte[] bytes, int off) { bytes[off + 1] = (byte) (i >> 8); bytes[off] = (byte) i; return bytes; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); st...
@Test public void testIntToBytesBE() { assertArrayEquals(INT_12345_BE, ByteUtils.intToBytesBE(-12345, new byte[4] , 0)); }
public static byte[] intToBytesBE(int i, byte[] bytes, int off) { bytes[off] = (byte) (i >> 24); bytes[off + 1] = (byte) (i >> 16); bytes[off + 2] = (byte) (i >> 8); bytes[off + 3] = (byte) i; return bytes; }
ByteUtils { public static byte[] intToBytesBE(int i, byte[] bytes, int off) { bytes[off] = (byte) (i >> 24); bytes[off + 1] = (byte) (i >> 16); bytes[off + 2] = (byte) (i >> 8); bytes[off + 3] = (byte) i; return bytes; } }
ByteUtils { public static byte[] intToBytesBE(int i, byte[] bytes, int off) { bytes[off] = (byte) (i >> 24); bytes[off + 1] = (byte) (i >> 16); bytes[off + 2] = (byte) (i >> 8); bytes[off + 3] = (byte) i; return bytes; } }
ByteUtils { public static byte[] intToBytesBE(int i, byte[] bytes, int off) { bytes[off] = (byte) (i >> 24); bytes[off + 1] = (byte) (i >> 16); bytes[off + 2] = (byte) (i >> 8); bytes[off + 3] = (byte) i; return bytes; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boole...
ByteUtils { public static byte[] intToBytesBE(int i, byte[] bytes, int off) { bytes[off] = (byte) (i >> 24); bytes[off + 1] = (byte) (i >> 16); bytes[off + 2] = (byte) (i >> 8); bytes[off + 3] = (byte) i; return bytes; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boole...
@Test public void testIntToBytesLE() { assertArrayEquals(INT_12345_LE, ByteUtils.intToBytesLE(-12345, new byte[4] , 0)); }
public static byte[] intToBytesLE(int i, byte[] bytes, int off) { bytes[off + 3] = (byte) (i >> 24); bytes[off + 2] = (byte) (i >> 16); bytes[off + 1] = (byte) (i >> 8); bytes[off] = (byte) i; return bytes; }
ByteUtils { public static byte[] intToBytesLE(int i, byte[] bytes, int off) { bytes[off + 3] = (byte) (i >> 24); bytes[off + 2] = (byte) (i >> 16); bytes[off + 1] = (byte) (i >> 8); bytes[off] = (byte) i; return bytes; } }
ByteUtils { public static byte[] intToBytesLE(int i, byte[] bytes, int off) { bytes[off + 3] = (byte) (i >> 24); bytes[off + 2] = (byte) (i >> 16); bytes[off + 1] = (byte) (i >> 8); bytes[off] = (byte) i; return bytes; } }
ByteUtils { public static byte[] intToBytesLE(int i, byte[] bytes, int off) { bytes[off + 3] = (byte) (i >> 24); bytes[off + 2] = (byte) (i >> 16); bytes[off + 1] = (byte) (i >> 8); bytes[off] = (byte) i; return bytes; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boole...
ByteUtils { public static byte[] intToBytesLE(int i, byte[] bytes, int off) { bytes[off + 3] = (byte) (i >> 24); bytes[off + 2] = (byte) (i >> 16); bytes[off + 1] = (byte) (i >> 8); bytes[off] = (byte) i; return bytes; } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boole...
@Test public void testTagToBytesBE() { assertArrayEquals(TAG_PIXEL_DATA_BE, ByteUtils.tagToBytesBE(Tag.PixelData, new byte[4] , 0)); }
public static byte[] tagToBytesBE(int i, byte[] bytes, int off) { return intToBytesBE(i, bytes, off); }
ByteUtils { public static byte[] tagToBytesBE(int i, byte[] bytes, int off) { return intToBytesBE(i, bytes, off); } }
ByteUtils { public static byte[] tagToBytesBE(int i, byte[] bytes, int off) { return intToBytesBE(i, bytes, off); } }
ByteUtils { public static byte[] tagToBytesBE(int i, byte[] bytes, int off) { return intToBytesBE(i, bytes, off); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes...
ByteUtils { public static byte[] tagToBytesBE(int i, byte[] bytes, int off) { return intToBytesBE(i, bytes, off); } static int bytesToVR(byte[] bytes, int off); static int bytesToUShort(byte[] bytes, int off, boolean bigEndian); static int bytesToUShortBE(byte[] bytes, int off); static int bytesToUShortLE(byte[] bytes...
@Test public void testValueOf() { AttributeSelector selector = AttributeSelector.valueOf(XPATH); assertEquals(Tag.StudyInstanceUID, selector.tag()); assertNull(selector.privateCreator()); assertEquals(1, selector.level()); ItemPointer ip = selector.itemPointer(0); assertEquals(Tag.RequestAttributesSequence, ip.sequence...
public static AttributeSelector valueOf(String s) { int fromIndex = s.lastIndexOf("DicomAttribute"); try { return new AttributeSelector( selectTag(s, fromIndex), selectPrivateCreator(s, fromIndex), itemPointersOf(s, fromIndex)); } catch (Exception e) { throw new IllegalArgumentException(s); } }
AttributeSelector implements Serializable { public static AttributeSelector valueOf(String s) { int fromIndex = s.lastIndexOf("DicomAttribute"); try { return new AttributeSelector( selectTag(s, fromIndex), selectPrivateCreator(s, fromIndex), itemPointersOf(s, fromIndex)); } catch (Exception e) { throw new IllegalArgume...
AttributeSelector implements Serializable { public static AttributeSelector valueOf(String s) { int fromIndex = s.lastIndexOf("DicomAttribute"); try { return new AttributeSelector( selectTag(s, fromIndex), selectPrivateCreator(s, fromIndex), itemPointersOf(s, fromIndex)); } catch (Exception e) { throw new IllegalArgume...
AttributeSelector implements Serializable { public static AttributeSelector valueOf(String s) { int fromIndex = s.lastIndexOf("DicomAttribute"); try { return new AttributeSelector( selectTag(s, fromIndex), selectPrivateCreator(s, fromIndex), itemPointersOf(s, fromIndex)); } catch (Exception e) { throw new IllegalArgume...
AttributeSelector implements Serializable { public static AttributeSelector valueOf(String s) { int fromIndex = s.lastIndexOf("DicomAttribute"); try { return new AttributeSelector( selectTag(s, fromIndex), selectPrivateCreator(s, fromIndex), itemPointersOf(s, fromIndex)); } catch (Exception e) { throw new IllegalArgume...
@Test public void testUndertowHttp2Enabled() { props.getHttp().setVersion(JHipsterProperties.Http.Version.V_2_0); UndertowEmbeddedServletContainerFactory container = new UndertowEmbeddedServletContainerFactory(); webConfigurer.customize(container); Builder builder = Undertow.builder(); container.getBuilderCustomizers()...
@Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;charset=utf-8"); container.setMimeMappings(mappings); setLocationForStaticAssets(container); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
@Test public void testStartUpProdServletContext() throws ServletException { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); webConfigurer.onStartup(servletContext); assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry); assertThat(servletContext.get...
@Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); } EnumSet<DispatcherType> disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWA...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
@Test public void testStartUpDevServletContext() throws ServletException { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); webConfigurer.onStartup(servletContext); assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry); assertThat(servletContext.get...
@Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); } EnumSet<DispatcherType> disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWA...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
@Test public void testCustomizeServletContainer() { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); UndertowEmbeddedServletContainerFactory container = new UndertowEmbeddedServletContainerFactory(); webConfigurer.customize(container); assertThat(container.getMimeMappings().get("abs")).isEqualTo("aud...
@Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;charset=utf-8"); container.setMimeMappings(mappings); if (jHipsterProperties.getHttp().getVer...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
@Test public void testUndertowHttp2Enabled() { props.getHttp().setVersion(JHipsterProperties.Http.Version.V_2_0); UndertowEmbeddedServletContainerFactory container = new UndertowEmbeddedServletContainerFactory(); webConfigurer.customize(container); Builder builder = Undertow.builder(); container.getBuilderCustomizers()...
@Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;charset=utf-8"); container.setMimeMappings(mappings); if (jHipsterProperties.getHttp().getVer...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
@Test public void testCorsFilterOnApiPath() throws Exception { props.getCors().setAllowedOrigins(Collections.singletonList("*")); props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); props.getCors().setAllowedHeaders(Collections.singletonList("*")); props.getCors().setMaxAge(1800L); props.g...
@Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) { log.debug("Registering CORS filter"); source.registerCorsConf...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
@Test public void testCorsFilterOnOtherPath() throws Exception { props.getCors().setAllowedOrigins(Collections.singletonList("*")); props.getCors().setAllowedMethods(Arrays.asList("GET", "POST", "PUT", "DELETE")); props.getCors().setAllowedHeaders(Collections.singletonList("*")); props.getCors().setMaxAge(1800L); props...
@Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) { log.debug("Registering CORS filter"); source.registerCorsConf...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
@Test public void testCorsFilterDeactivated() throws Exception { props.getCors().setAllowedOrigins(null); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) .addFilters(webConfigurer.corsFilter()) .build(); mockMvc.perform( get("/api/test-cors") .header(HttpHeaders.ORIGIN, "other.domai...
@Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) { log.debug("Registering CORS filter"); source.registerCorsConf...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
@Test public void testCorsFilterDeactivated2() throws Exception { props.getCors().setAllowedOrigins(new ArrayList<>()); MockMvc mockMvc = MockMvcBuilders.standaloneSetup(new WebConfigurerTestController()) .addFilters(webConfigurer.corsFilter()) .build(); mockMvc.perform( get("/api/test-cors") .header(HttpHeaders.ORIGIN...
@Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAllowedOrigins().isEmpty()) { log.debug("Registering CORS filter"); source.registerCorsConf...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Bean public CorsFilter corsFilter() { UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); CorsConfiguration config = jHipsterProperties.getCors(); if (config.getAllowedOrigins() != null && !config.getAl...
@Test public void testCustomizeServletContainer() { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); UndertowEmbeddedServletContainerFactory container = new UndertowEmbeddedServletContainerFactory(); webConfigurer.customize(container); assertThat(container.getMimeMappings().get("abs")).isEqualTo("aud...
@Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;charset=utf-8"); container.setMimeMappings(mappings); setLocationForStaticAssets(container); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
@Test public void testStartUpProdServletContext() throws ServletException { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); webConfigurer.onStartup(servletContext); assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry); assertThat(servletContext.get...
@Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); } EnumSet<DispatcherType> disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWA...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
@Test public void testStartUpDevServletContext() throws ServletException { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT); webConfigurer.onStartup(servletContext); assertThat(servletContext.getAttribute(InstrumentedFilter.REGISTRY_ATTRIBUTE)).isEqualTo(metricRegistry); assertThat(servletContext.get...
@Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); } EnumSet<DispatcherType> disps = EnumSet.of(DispatcherType.REQUEST, DispatcherType.FORWA...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void onStartup(ServletContext servletContext) throws ServletException { if (env.getActiveProfiles().length != 0) { log.info("Web application configuration, using profiles: {}", (Object[]) env.getActiveProfiles()); ...
@Test public void testCustomizeServletContainer() { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); UndertowEmbeddedServletContainerFactory container = new UndertowEmbeddedServletContainerFactory(); webConfigurer.customize(container); assertThat(container.getMimeMappings().get("abs")).isEqualTo("aud...
@Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;charset=utf-8"); container.setMimeMappings(mappings); setLocationForStaticAssets(container); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
@Test public void testSlug() { System.out.println("getSlug"); Post instance = new Post(); instance.setTitle("test post 1"); instance.slugify(); assertEquals("test-post-1", instance.getSlug()); }
@PrePersist public void slugify(){ this.slug = new Slugify().slugify(this.title); }
Post extends AuditableEntity { @PrePersist public void slugify(){ this.slug = new Slugify().slugify(this.title); } }
Post extends AuditableEntity { @PrePersist public void slugify(){ this.slug = new Slugify().slugify(this.title); } }
Post extends AuditableEntity { @PrePersist public void slugify(){ this.slug = new Slugify().slugify(this.title); } @PrePersist void slugify(); }
Post extends AuditableEntity { @PrePersist public void slugify(){ this.slug = new Slugify().slugify(this.title); } @PrePersist void slugify(); }
@Test public void createPost() { final String TITLE = "test post title"; final String CONTENT = "test post content"; final PostForm input = PostForm.builder().title(TITLE).content(CONTENT).build(); Post expected = Post.builder().title(TITLE).content(CONTENT).build(); expected.setId(1L); given(posts.save(Post.builder()....
public Post createPost(PostForm form) { Post _post = Post.builder() .title(form.getTitle()) .content(form.getContent()) .build(); Post saved = this.postRepository.save(_post); return saved; }
PostService { public Post createPost(PostForm form) { Post _post = Post.builder() .title(form.getTitle()) .content(form.getContent()) .build(); Post saved = this.postRepository.save(_post); return saved; } }
PostService { public Post createPost(PostForm form) { Post _post = Post.builder() .title(form.getTitle()) .content(form.getContent()) .build(); Post saved = this.postRepository.save(_post); return saved; } }
PostService { public Post createPost(PostForm form) { Post _post = Post.builder() .title(form.getTitle()) .content(form.getContent()) .build(); Post saved = this.postRepository.save(_post); return saved; } Post createPost(PostForm form); Post updatePost(String slug, PostForm form); void deletePost(String slug); }
PostService { public Post createPost(PostForm form) { Post _post = Post.builder() .title(form.getTitle()) .content(form.getContent()) .build(); Post saved = this.postRepository.save(_post); return saved; } Post createPost(PostForm form); Post updatePost(String slug, PostForm form); void deletePost(String slug); }
@Test public void testFindbyUsername() { this.server.expect(requestTo(userServiceUrl + "/users/user")) .andRespond(withSuccess(new ClassPathResource("/find-user-by-username.json"), MediaType.APPLICATION_JSON_UTF8)); User user = this.client.findByUsername("user"); assertNotNull(user); assertEquals("user", user.getUserna...
public User findByUsername(String username) { try { ResponseEntity<User> response = this.restTemplate.getForEntity(userServiceUrl + "/users/{username}", User.class, username); return response.getBody(); } catch (HttpClientErrorException e) { if (e.getStatusCode() == NOT_FOUND) { return null; } } return null; }
UserServiceClient { public User findByUsername(String username) { try { ResponseEntity<User> response = this.restTemplate.getForEntity(userServiceUrl + "/users/{username}", User.class, username); return response.getBody(); } catch (HttpClientErrorException e) { if (e.getStatusCode() == NOT_FOUND) { return null; } } ret...
UserServiceClient { public User findByUsername(String username) { try { ResponseEntity<User> response = this.restTemplate.getForEntity(userServiceUrl + "/users/{username}", User.class, username); return response.getBody(); } catch (HttpClientErrorException e) { if (e.getStatusCode() == NOT_FOUND) { return null; } } ret...
UserServiceClient { public User findByUsername(String username) { try { ResponseEntity<User> response = this.restTemplate.getForEntity(userServiceUrl + "/users/{username}", User.class, username); return response.getBody(); } catch (HttpClientErrorException e) { if (e.getStatusCode() == NOT_FOUND) { return null; } } ret...
UserServiceClient { public User findByUsername(String username) { try { ResponseEntity<User> response = this.restTemplate.getForEntity(userServiceUrl + "/users/{username}", User.class, username); return response.getBody(); } catch (HttpClientErrorException e) { if (e.getStatusCode() == NOT_FOUND) { return null; } } ret...
@Test public void testFindbyUsername_notFound() { this.server.expect(requestTo(userServiceUrl + "/users/user1")) .andRespond(withStatus(NOT_FOUND)); User user = this.client.findByUsername("user1"); assertNull(user); this.server.verify(); }
public User findByUsername(String username) { try { ResponseEntity<User> response = this.restTemplate.getForEntity(userServiceUrl + "/users/{username}", User.class, username); return response.getBody(); } catch (HttpClientErrorException e) { if (e.getStatusCode() == NOT_FOUND) { return null; } } return null; }
UserServiceClient { public User findByUsername(String username) { try { ResponseEntity<User> response = this.restTemplate.getForEntity(userServiceUrl + "/users/{username}", User.class, username); return response.getBody(); } catch (HttpClientErrorException e) { if (e.getStatusCode() == NOT_FOUND) { return null; } } ret...
UserServiceClient { public User findByUsername(String username) { try { ResponseEntity<User> response = this.restTemplate.getForEntity(userServiceUrl + "/users/{username}", User.class, username); return response.getBody(); } catch (HttpClientErrorException e) { if (e.getStatusCode() == NOT_FOUND) { return null; } } ret...
UserServiceClient { public User findByUsername(String username) { try { ResponseEntity<User> response = this.restTemplate.getForEntity(userServiceUrl + "/users/{username}", User.class, username); return response.getBody(); } catch (HttpClientErrorException e) { if (e.getStatusCode() == NOT_FOUND) { return null; } } ret...
UserServiceClient { public User findByUsername(String username) { try { ResponseEntity<User> response = this.restTemplate.getForEntity(userServiceUrl + "/users/{username}", User.class, username); return response.getBody(); } catch (HttpClientErrorException e) { if (e.getStatusCode() == NOT_FOUND) { return null; } } ret...
@Test public void shouldCreateSmallExportImage() throws IOException { BufferedImage exportedImage = graphExporter.exportCurrentGraph(graph, 1.0, null, null); BufferedImage referenceImage = ImageIO.read(getClass().getResourceAsStream("/export-small.png")); Assert.assertEquals("", TestUtils.bufferedImagesEqual(exportedIm...
public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null) { mxCell curren...
GraphExporter { public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null)...
GraphExporter { public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null)...
GraphExporter { public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null)...
GraphExporter { public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null)...
@Test public void shouldCreateMediumExportImage() throws IOException { BufferedImage exportedImage = graphExporter.exportCurrentGraph(graph, 2.0, null, null); BufferedImage referenceImage = ImageIO.read(getClass().getResourceAsStream("/export-medium.png")); Assert.assertEquals("", TestUtils.bufferedImagesEqual(exported...
public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null) { mxCell curren...
GraphExporter { public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null)...
GraphExporter { public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null)...
GraphExporter { public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null)...
GraphExporter { public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null)...
@Test public void shouldCreateLargeExportImage() throws IOException { BufferedImage exportedImage = graphExporter.exportCurrentGraph(graph, 3.0, null, null); BufferedImage referenceImage = ImageIO.read(getClass().getResourceAsStream("/export-large.png")); Assert.assertEquals("", TestUtils.bufferedImagesEqual(exportedIm...
public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null) { mxCell curren...
GraphExporter { public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null)...
GraphExporter { public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null)...
GraphExporter { public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null)...
GraphExporter { public BufferedImage exportCurrentGraph(mxGraph graph, double scale, UIAbstractBlock selectedBlock, BlockState<? extends LatticeElement> state) { BufferedImage graphImage; int stateImageWidth = (int) (STATE_AREA_WIDTH * scale); BufferedImage stateImage = null; if (selectedBlock != null && state != null)...
@Test public void shouldPerformBatchExport() throws InterruptedException { String code = "public class shouldPerformBatchExportClass { int test(int a) { " + " if (a < 10) { " + " a = 20; " + " } " + " return a*2; " + " } }"; CodeProcessor codeProcessor = new CodeProcessor(code); GraphBuilder builder = new GraphBuilder(...
public void batchExportAsync(DFAExecution<? extends LatticeElement> dfa, double scale, boolean includeLineSteps, GraphExportCallback callback) { dfa = dfa.clone(); VisualGraphPanel panel = new VisualGraphPanel(); panel.setJumpToAction(true); GraphUIController controller = new GraphUIController(panel); controller.start(...
GraphExporter { public void batchExportAsync(DFAExecution<? extends LatticeElement> dfa, double scale, boolean includeLineSteps, GraphExportCallback callback) { dfa = dfa.clone(); VisualGraphPanel panel = new VisualGraphPanel(); panel.setJumpToAction(true); GraphUIController controller = new GraphUIController(panel); c...
GraphExporter { public void batchExportAsync(DFAExecution<? extends LatticeElement> dfa, double scale, boolean includeLineSteps, GraphExportCallback callback) { dfa = dfa.clone(); VisualGraphPanel panel = new VisualGraphPanel(); panel.setJumpToAction(true); GraphUIController controller = new GraphUIController(panel); c...
GraphExporter { public void batchExportAsync(DFAExecution<? extends LatticeElement> dfa, double scale, boolean includeLineSteps, GraphExportCallback callback) { dfa = dfa.clone(); VisualGraphPanel panel = new VisualGraphPanel(); panel.setJumpToAction(true); GraphUIController controller = new GraphUIController(panel); c...
GraphExporter { public void batchExportAsync(DFAExecution<? extends LatticeElement> dfa, double scale, boolean includeLineSteps, GraphExportCallback callback) { dfa = dfa.clone(); VisualGraphPanel panel = new VisualGraphPanel(); panel.setJumpToAction(true); GraphUIController controller = new GraphUIController(panel); c...
@Test public void graphBatchExportThreadShouldWork() throws InterruptedException { new GraphBatchExportThread(mockExporter, dfa, 3.0, false, null).run(); verify(mockExporter, times(1)).batchExportAsync(dfa, 3.0, false, null); }
public void batchExportAsync(DFAExecution<? extends LatticeElement> dfa, double scale, boolean includeLineSteps, GraphExportCallback callback) { dfa = dfa.clone(); VisualGraphPanel panel = new VisualGraphPanel(); panel.setJumpToAction(true); GraphUIController controller = new GraphUIController(panel); controller.start(...
GraphExporter { public void batchExportAsync(DFAExecution<? extends LatticeElement> dfa, double scale, boolean includeLineSteps, GraphExportCallback callback) { dfa = dfa.clone(); VisualGraphPanel panel = new VisualGraphPanel(); panel.setJumpToAction(true); GraphUIController controller = new GraphUIController(panel); c...
GraphExporter { public void batchExportAsync(DFAExecution<? extends LatticeElement> dfa, double scale, boolean includeLineSteps, GraphExportCallback callback) { dfa = dfa.clone(); VisualGraphPanel panel = new VisualGraphPanel(); panel.setJumpToAction(true); GraphUIController controller = new GraphUIController(panel); c...
GraphExporter { public void batchExportAsync(DFAExecution<? extends LatticeElement> dfa, double scale, boolean includeLineSteps, GraphExportCallback callback) { dfa = dfa.clone(); VisualGraphPanel panel = new VisualGraphPanel(); panel.setJumpToAction(true); GraphUIController controller = new GraphUIController(panel); c...
GraphExporter { public void batchExportAsync(DFAExecution<? extends LatticeElement> dfa, double scale, boolean includeLineSteps, GraphExportCallback callback) { dfa = dfa.clone(); VisualGraphPanel panel = new VisualGraphPanel(); panel.setJumpToAction(true); GraphUIController controller = new GraphUIController(panel); c...
@Test(expected = IllegalStateException.class) public void refreshShouldNotBePossibleBeforeStart() { controller.refresh(); }
public void refresh() { if (dfa == null) { throw new IllegalStateException("Graph has not been built using start() yet."); } panel.renderGraph(dfa); if (!panel.isJumpToActionEnabled()) { updateStatePanel(); } }
GraphUIController { public void refresh() { if (dfa == null) { throw new IllegalStateException("Graph has not been built using start() yet."); } panel.renderGraph(dfa); if (!panel.isJumpToActionEnabled()) { updateStatePanel(); } } }
GraphUIController { public void refresh() { if (dfa == null) { throw new IllegalStateException("Graph has not been built using start() yet."); } panel.renderGraph(dfa); if (!panel.isJumpToActionEnabled()) { updateStatePanel(); } } GraphUIController(VisualGraphPanel panel); }
GraphUIController { public void refresh() { if (dfa == null) { throw new IllegalStateException("Graph has not been built using start() yet."); } panel.renderGraph(dfa); if (!panel.isJumpToActionEnabled()) { updateStatePanel(); } } GraphUIController(VisualGraphPanel panel); void start(final DFAExecution<? extends Lattic...
GraphUIController { public void refresh() { if (dfa == null) { throw new IllegalStateException("Graph has not been built using start() yet."); } panel.renderGraph(dfa); if (!panel.isJumpToActionEnabled()) { updateStatePanel(); } } GraphUIController(VisualGraphPanel panel); void start(final DFAExecution<? extends Lattic...
@Test(expected = IllegalStateException.class) public void startShouldNotBePossibleTwice() { CodeProcessor codeProcessor = new CodeProcessor("void emptyInside() {}"); GraphBuilder builder = new GraphBuilder(codeProcessor.getPath(), codeProcessor.getClassName()); SimpleBlockGraph blockGraph = builder.buildGraph("void emp...
public void start(final DFAExecution<? extends LatticeElement> dfa) { if (this.dfa != null) { throw new IllegalStateException("Visual graph was already built."); } this.dfa = dfa; ControlFlowGraph dfaGraph = dfa.getCFG(); List<BasicBlock> dfaBasicBlocks = dfaGraph.getBasicBlocks(); Map<BasicBlock, UIBasicBlock> mappedB...
GraphUIController { public void start(final DFAExecution<? extends LatticeElement> dfa) { if (this.dfa != null) { throw new IllegalStateException("Visual graph was already built."); } this.dfa = dfa; ControlFlowGraph dfaGraph = dfa.getCFG(); List<BasicBlock> dfaBasicBlocks = dfaGraph.getBasicBlocks(); Map<BasicBlock, U...
GraphUIController { public void start(final DFAExecution<? extends LatticeElement> dfa) { if (this.dfa != null) { throw new IllegalStateException("Visual graph was already built."); } this.dfa = dfa; ControlFlowGraph dfaGraph = dfa.getCFG(); List<BasicBlock> dfaBasicBlocks = dfaGraph.getBasicBlocks(); Map<BasicBlock, U...
GraphUIController { public void start(final DFAExecution<? extends LatticeElement> dfa) { if (this.dfa != null) { throw new IllegalStateException("Visual graph was already built."); } this.dfa = dfa; ControlFlowGraph dfaGraph = dfa.getCFG(); List<BasicBlock> dfaBasicBlocks = dfaGraph.getBasicBlocks(); Map<BasicBlock, U...
GraphUIController { public void start(final DFAExecution<? extends LatticeElement> dfa) { if (this.dfa != null) { throw new IllegalStateException("Visual graph was already built."); } this.dfa = dfa; ControlFlowGraph dfaGraph = dfa.getCFG(); List<BasicBlock> dfaBasicBlocks = dfaGraph.getBasicBlocks(); Map<BasicBlock, U...
@Test public void spanFromPayload_startsTraceOnNullPayload() { assertThat(cassandraTracing.spanFromPayload(tracing.tracer(), null)) .isNotNull(); }
Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.decode(b3)); if (extracted == null) return tracer.nextSp...
Tracing extends org.apache.cassandra.tracing.Tracing { Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.d...
Tracing extends org.apache.cassandra.tracing.Tracing { Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.d...
Tracing extends org.apache.cassandra.tracing.Tracing { Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.d...
Tracing extends org.apache.cassandra.tracing.Tracing { Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.d...
@Test public void spanFromPayload_startsTraceOnAbsentB3SingleEntry() { assertThat(cassandraTracing.spanFromPayload(tracing.tracer(), Collections.emptyMap())) .isNotNull(); }
Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.decode(b3)); if (extracted == null) return tracer.nextSp...
Tracing extends org.apache.cassandra.tracing.Tracing { Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.d...
Tracing extends org.apache.cassandra.tracing.Tracing { Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.d...
Tracing extends org.apache.cassandra.tracing.Tracing { Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.d...
Tracing extends org.apache.cassandra.tracing.Tracing { Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.d...
@Test public void spanFromPayload_resumesTraceOnB3SingleEntry() { assertThat(cassandraTracing.spanFromPayload(tracing.tracer(), Collections.singletonMap("b3", ByteBuffer.wrap(new byte[] {'0'})))) .extracting(b -> b.isNoop()) .isEqualTo(Boolean.TRUE); }
Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.decode(b3)); if (extracted == null) return tracer.nextSp...
Tracing extends org.apache.cassandra.tracing.Tracing { Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.d...
Tracing extends org.apache.cassandra.tracing.Tracing { Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.d...
Tracing extends org.apache.cassandra.tracing.Tracing { Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.d...
Tracing extends org.apache.cassandra.tracing.Tracing { Span spanFromPayload(Tracer tracer, @Nullable Map<String, ByteBuffer> payload) { ByteBuffer b3 = payload != null ? payload.get("b3") : null; if (b3 == null) return tracer.nextSpan(); TraceContextOrSamplingFlags extracted = B3SingleFormat.parseB3SingleFormat(UTF_8.d...
@Test public void testConnect() throws Exception { directedGraph.connect("F", "G", 1d); assertEquals("F", directedGraph.incomingEdgesOf("G").iterator().next().getVertex1()); }
@Override public GraphEdge<V,E> connect(V v1, V v2, E value){ Preconditions.checkArgument(v1 != null && v2 != null, "Vertices cannot be null"); GraphEdge<V,E> edge = new DirectedEdge<V, E>(v1, v2, value); graphTable.put(v1, v2, edge); disconnected.remove(v1); disconnected.remove(v2); return edge; }
HashTableHipsterDirectedGraph extends HashTableHipsterGraph<V,E> implements HipsterDirectedGraph<V,E> { @Override public GraphEdge<V,E> connect(V v1, V v2, E value){ Preconditions.checkArgument(v1 != null && v2 != null, "Vertices cannot be null"); GraphEdge<V,E> edge = new DirectedEdge<V, E>(v1, v2, value); graphTable....
HashTableHipsterDirectedGraph extends HashTableHipsterGraph<V,E> implements HipsterDirectedGraph<V,E> { @Override public GraphEdge<V,E> connect(V v1, V v2, E value){ Preconditions.checkArgument(v1 != null && v2 != null, "Vertices cannot be null"); GraphEdge<V,E> edge = new DirectedEdge<V, E>(v1, v2, value); graphTable....
HashTableHipsterDirectedGraph extends HashTableHipsterGraph<V,E> implements HipsterDirectedGraph<V,E> { @Override public GraphEdge<V,E> connect(V v1, V v2, E value){ Preconditions.checkArgument(v1 != null && v2 != null, "Vertices cannot be null"); GraphEdge<V,E> edge = new DirectedEdge<V, E>(v1, v2, value); graphTable....
HashTableHipsterDirectedGraph extends HashTableHipsterGraph<V,E> implements HipsterDirectedGraph<V,E> { @Override public GraphEdge<V,E> connect(V v1, V v2, E value){ Preconditions.checkArgument(v1 != null && v2 != null, "Vertices cannot be null"); GraphEdge<V,E> edge = new DirectedEdge<V, E>(v1, v2, value); graphTable....
@Test public void testEdgesWithDisconnectedVertices() throws Exception { graph.add("X"); graph.add("Y"); testGraphEdges(); }
@Override public boolean add(V v){ if(!connected.containsKey(v)){ connected.put(v, new LinkedHashSet<GraphEdge<V, E>>()); return true; } return false; }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public boolean add(V v){ if(!connected.containsKey(v)){ connected.put(v, new LinkedHashSet<GraphEdge<V, E>>()); return true; } return false; } }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public boolean add(V v){ if(!connected.containsKey(v)){ connected.put(v, new LinkedHashSet<GraphEdge<V, E>>()); return true; } return false; } HashBasedHipsterGraph(); }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public boolean add(V v){ if(!connected.containsKey(v)){ connected.put(v, new LinkedHashSet<GraphEdge<V, E>>()); return true; } return false; } HashBasedHipsterGraph(); @Override boolean add(V v); @Override Set<V> add(V... vertices); @Override boolean...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public boolean add(V v){ if(!connected.containsKey(v)){ connected.put(v, new LinkedHashSet<GraphEdge<V, E>>()); return true; } return false; } HashBasedHipsterGraph(); @Override boolean add(V v); @Override Set<V> add(V... vertices); @Override boolean...
@Test public void testAdd() throws Exception { graph.add("X"); Set vertices = Sets.newHashSet(graph.vertices()); assertTrue(vertices.contains("X")); assertTrue(vertices.size()==size+1); }
@Override public boolean add(V v){ if(!connected.containsKey(v)){ connected.put(v, new LinkedHashSet<GraphEdge<V, E>>()); return true; } return false; }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public boolean add(V v){ if(!connected.containsKey(v)){ connected.put(v, new LinkedHashSet<GraphEdge<V, E>>()); return true; } return false; } }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public boolean add(V v){ if(!connected.containsKey(v)){ connected.put(v, new LinkedHashSet<GraphEdge<V, E>>()); return true; } return false; } HashBasedHipsterGraph(); }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public boolean add(V v){ if(!connected.containsKey(v)){ connected.put(v, new LinkedHashSet<GraphEdge<V, E>>()); return true; } return false; } HashBasedHipsterGraph(); @Override boolean add(V v); @Override Set<V> add(V... vertices); @Override boolean...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public boolean add(V v){ if(!connected.containsKey(v)){ connected.put(v, new LinkedHashSet<GraphEdge<V, E>>()); return true; } return false; } HashBasedHipsterGraph(); @Override boolean add(V v); @Override Set<V> add(V... vertices); @Override boolean...
@Test public void testRemove() throws Exception { graph.remove("v1"); assertFalse(Sets.newHashSet(graph.vertices()).contains("v1")); }
@Override public boolean remove(V v){ Set<GraphEdge<V, E>> edges = this.connected.get(v); if (edges == null) return false; for(Iterator<GraphEdge<V,E>> it = edges.iterator(); it.hasNext(); ){ GraphEdge<V,E> edge = it.next(); it.remove(); V v2 = edge.getVertex1().equals(v) ? edge.getVertex2() : edge.getVertex1(); for(It...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public boolean remove(V v){ Set<GraphEdge<V, E>> edges = this.connected.get(v); if (edges == null) return false; for(Iterator<GraphEdge<V,E>> it = edges.iterator(); it.hasNext(); ){ GraphEdge<V,E> edge = it.next(); it.remove(); V v2 = edge.getVertex1...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public boolean remove(V v){ Set<GraphEdge<V, E>> edges = this.connected.get(v); if (edges == null) return false; for(Iterator<GraphEdge<V,E>> it = edges.iterator(); it.hasNext(); ){ GraphEdge<V,E> edge = it.next(); it.remove(); V v2 = edge.getVertex1...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public boolean remove(V v){ Set<GraphEdge<V, E>> edges = this.connected.get(v); if (edges == null) return false; for(Iterator<GraphEdge<V,E>> it = edges.iterator(); it.hasNext(); ){ GraphEdge<V,E> edge = it.next(); it.remove(); V v2 = edge.getVertex1...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public boolean remove(V v){ Set<GraphEdge<V, E>> edges = this.connected.get(v); if (edges == null) return false; for(Iterator<GraphEdge<V,E>> it = edges.iterator(); it.hasNext(); ){ GraphEdge<V,E> edge = it.next(); it.remove(); V v2 = edge.getVertex1...
@Test public void testConnect() throws Exception { graph.add("X"); graph.add("Y"); graph.connect("X","Y",1.0d); assertTrue(Sets.newHashSet(graph.vertices()).contains("X")); assertTrue(Sets.newHashSet(graph.vertices()).contains("Y")); }
@Override public GraphEdge<V,E> connect(V v1, V v2, E value){ if(v1 == null || v2 == null) throw new IllegalArgumentException("Invalid vertices. A vertex cannot be null"); if (!connected.containsKey(v1)) throw new IllegalArgumentException(v1 + " is not a vertex of the graph"); if (!connected.containsKey(v2)) throw new ...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public GraphEdge<V,E> connect(V v1, V v2, E value){ if(v1 == null || v2 == null) throw new IllegalArgumentException("Invalid vertices. A vertex cannot be null"); if (!connected.containsKey(v1)) throw new IllegalArgumentException(v1 + " is not a verte...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public GraphEdge<V,E> connect(V v1, V v2, E value){ if(v1 == null || v2 == null) throw new IllegalArgumentException("Invalid vertices. A vertex cannot be null"); if (!connected.containsKey(v1)) throw new IllegalArgumentException(v1 + " is not a verte...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public GraphEdge<V,E> connect(V v1, V v2, E value){ if(v1 == null || v2 == null) throw new IllegalArgumentException("Invalid vertices. A vertex cannot be null"); if (!connected.containsKey(v1)) throw new IllegalArgumentException(v1 + " is not a verte...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public GraphEdge<V,E> connect(V v1, V v2, E value){ if(v1 == null || v2 == null) throw new IllegalArgumentException("Invalid vertices. A vertex cannot be null"); if (!connected.containsKey(v1)) throw new IllegalArgumentException(v1 + " is not a verte...
@Test public void testVertices() throws Exception { Set vertices = Sets.newHashSet(graph.vertices()); assertEquals(size, vertices.size()); }
@Override public Iterable<V> vertices() { return connected.keySet(); }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public Iterable<V> vertices() { return connected.keySet(); } }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public Iterable<V> vertices() { return connected.keySet(); } HashBasedHipsterGraph(); }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public Iterable<V> vertices() { return connected.keySet(); } HashBasedHipsterGraph(); @Override boolean add(V v); @Override Set<V> add(V... vertices); @Override boolean remove(V v); @Override Set<V> remove(V... vertices); @Override GraphEdge<V,E> con...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public Iterable<V> vertices() { return connected.keySet(); } HashBasedHipsterGraph(); @Override boolean add(V v); @Override Set<V> add(V... vertices); @Override boolean remove(V v); @Override Set<V> remove(V... vertices); @Override GraphEdge<V,E> con...
@Test public void testEdgesOf() throws Exception { Set edges = Sets.newHashSet(graph.edgesOf("v1")); assertEquals(size-1, edges.size()); }
@Override public Iterable<GraphEdge<V, E>> edgesOf(V vertex) { Set<GraphEdge<V, E>> set = connected.get(vertex); if (set == null) set = Collections.emptySet(); return set; }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edgesOf(V vertex) { Set<GraphEdge<V, E>> set = connected.get(vertex); if (set == null) set = Collections.emptySet(); return set; } }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edgesOf(V vertex) { Set<GraphEdge<V, E>> set = connected.get(vertex); if (set == null) set = Collections.emptySet(); return set; } HashBasedHipsterGraph(); }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edgesOf(V vertex) { Set<GraphEdge<V, E>> set = connected.get(vertex); if (set == null) set = Collections.emptySet(); return set; } HashBasedHipsterGraph(); @Override boolean add(V v); @Override Set<V> add(V... vertice...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edgesOf(V vertex) { Set<GraphEdge<V, E>> set = connected.get(vertex); if (set == null) set = Collections.emptySet(); return set; } HashBasedHipsterGraph(); @Override boolean add(V v); @Override Set<V> add(V... vertice...
@Test public void testOutgoingEdgesOf() throws Exception { for(int i=0; i<size; i++) { Set edges = Sets.newHashSet(graph.outgoingEdgesOf("v"+i)); assertEquals(size-(i+1), edges.size()); } }
@Override public Iterable<GraphEdge<V, E>> outgoingEdgesOf(final V vertex) { return F.filter(edgesOf(vertex), new Function<GraphEdge<V, E>, Boolean>() { @Override public Boolean apply(GraphEdge<V, E> edge) { return edge.getVertex1().equals(vertex); } }); }
HashBasedHipsterDirectedGraph extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> { @Override public Iterable<GraphEdge<V, E>> outgoingEdgesOf(final V vertex) { return F.filter(edgesOf(vertex), new Function<GraphEdge<V, E>, Boolean>() { @Override public Boolean apply(Gra...
HashBasedHipsterDirectedGraph extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> { @Override public Iterable<GraphEdge<V, E>> outgoingEdgesOf(final V vertex) { return F.filter(edgesOf(vertex), new Function<GraphEdge<V, E>, Boolean>() { @Override public Boolean apply(Gra...
HashBasedHipsterDirectedGraph extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> { @Override public Iterable<GraphEdge<V, E>> outgoingEdgesOf(final V vertex) { return F.filter(edgesOf(vertex), new Function<GraphEdge<V, E>, Boolean>() { @Override public Boolean apply(Gra...
HashBasedHipsterDirectedGraph extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> { @Override public Iterable<GraphEdge<V, E>> outgoingEdgesOf(final V vertex) { return F.filter(edgesOf(vertex), new Function<GraphEdge<V, E>, Boolean>() { @Override public Boolean apply(Gra...
@Test public void testIncomingEdgesOf() throws Exception { for(int i=0; i<size; i++) { Set edges = Sets.newHashSet(graph.incomingEdgesOf("v"+i)); assertEquals(i, edges.size()); } }
@Override public Iterable<GraphEdge<V, E>> incomingEdgesOf(final V vertex) { return F.filter(edgesOf(vertex), new Function<GraphEdge<V, E>, Boolean>() { @Override public Boolean apply(GraphEdge<V, E> edge) { return edge.getVertex2().equals(vertex); } }); }
HashBasedHipsterDirectedGraph extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> { @Override public Iterable<GraphEdge<V, E>> incomingEdgesOf(final V vertex) { return F.filter(edgesOf(vertex), new Function<GraphEdge<V, E>, Boolean>() { @Override public Boolean apply(Gra...
HashBasedHipsterDirectedGraph extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> { @Override public Iterable<GraphEdge<V, E>> incomingEdgesOf(final V vertex) { return F.filter(edgesOf(vertex), new Function<GraphEdge<V, E>, Boolean>() { @Override public Boolean apply(Gra...
HashBasedHipsterDirectedGraph extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> { @Override public Iterable<GraphEdge<V, E>> incomingEdgesOf(final V vertex) { return F.filter(edgesOf(vertex), new Function<GraphEdge<V, E>, Boolean>() { @Override public Boolean apply(Gra...
HashBasedHipsterDirectedGraph extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> { @Override public Iterable<GraphEdge<V, E>> incomingEdgesOf(final V vertex) { return F.filter(edgesOf(vertex), new Function<GraphEdge<V, E>, Boolean>() { @Override public Boolean apply(Gra...
@Test public void testEdges() throws Exception { Set edges = Sets.newHashSet(graph.edges()); assertEquals(size*(size-1)/2, edges.size()); }
@Override public Iterable<GraphEdge<V, E>> edges() { return F.map( F.filter(HashBasedHipsterDirectedGraph.super.vedges(), new Function<Map.Entry<V, GraphEdge<V, E>>, Boolean>() { @Override public Boolean apply(Map.Entry<V, GraphEdge<V, E>> input) { return input.getKey().equals(input.getValue().getVertex1()); } }), new ...
HashBasedHipsterDirectedGraph extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> { @Override public Iterable<GraphEdge<V, E>> edges() { return F.map( F.filter(HashBasedHipsterDirectedGraph.super.vedges(), new Function<Map.Entry<V, GraphEdge<V, E>>, Boolean>() { @Overrid...
HashBasedHipsterDirectedGraph extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> { @Override public Iterable<GraphEdge<V, E>> edges() { return F.map( F.filter(HashBasedHipsterDirectedGraph.super.vedges(), new Function<Map.Entry<V, GraphEdge<V, E>>, Boolean>() { @Overrid...
HashBasedHipsterDirectedGraph extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> { @Override public Iterable<GraphEdge<V, E>> edges() { return F.map( F.filter(HashBasedHipsterDirectedGraph.super.vedges(), new Function<Map.Entry<V, GraphEdge<V, E>>, Boolean>() { @Overrid...
HashBasedHipsterDirectedGraph extends HashBasedHipsterGraph<V, E> implements HipsterMutableGraph<V, E>, HipsterDirectedGraph<V, E> { @Override public Iterable<GraphEdge<V, E>> edges() { return F.map( F.filter(HashBasedHipsterDirectedGraph.super.vedges(), new Function<Map.Entry<V, GraphEdge<V, E>>, Boolean>() { @Overrid...
@Test public void testOutgoingEdgesOf() throws Exception { Set<DirectedEdge<String, Double>> expected = new HashSet<DirectedEdge<String, Double>>(); expected.add(new DirectedEdge<String, Double>("B", "C", 5d)); expected.add(new DirectedEdge<String, Double>("B", "D", 10d)); assertEquals(expected, Sets.newHashSet(directe...
@Override public Iterable<GraphEdge<V, E>> outgoingEdgesOf(V vertex) { return graphTable.row(vertex).values(); }
HashTableHipsterDirectedGraph extends HashTableHipsterGraph<V,E> implements HipsterDirectedGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> outgoingEdgesOf(V vertex) { return graphTable.row(vertex).values(); } }
HashTableHipsterDirectedGraph extends HashTableHipsterGraph<V,E> implements HipsterDirectedGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> outgoingEdgesOf(V vertex) { return graphTable.row(vertex).values(); } }
HashTableHipsterDirectedGraph extends HashTableHipsterGraph<V,E> implements HipsterDirectedGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> outgoingEdgesOf(V vertex) { return graphTable.row(vertex).values(); } @Override GraphEdge<V,E> connect(V v1, V v2, E value); @Override Iterable<GraphEdge<V, E>> outgoingEdg...
HashTableHipsterDirectedGraph extends HashTableHipsterGraph<V,E> implements HipsterDirectedGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> outgoingEdgesOf(V vertex) { return graphTable.row(vertex).values(); } @Override GraphEdge<V,E> connect(V v1, V v2, E value); @Override Iterable<GraphEdge<V, E>> outgoingEdg...
@Test public void testIncomingEdgesOf() throws Exception { Set<DirectedEdge<String, Double>> expected = new HashSet<DirectedEdge<String, Double>>(); expected.add(new DirectedEdge<String, Double>("B", "C", 5d)); expected.add(new DirectedEdge<String, Double>("A", "C", 2d)); assertEquals(expected, Sets.newHashSet(directed...
@Override public Iterable<GraphEdge<V, E>> incomingEdgesOf(V vertex) { return graphTable.column(vertex).values(); }
HashTableHipsterDirectedGraph extends HashTableHipsterGraph<V,E> implements HipsterDirectedGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> incomingEdgesOf(V vertex) { return graphTable.column(vertex).values(); } }
HashTableHipsterDirectedGraph extends HashTableHipsterGraph<V,E> implements HipsterDirectedGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> incomingEdgesOf(V vertex) { return graphTable.column(vertex).values(); } }
HashTableHipsterDirectedGraph extends HashTableHipsterGraph<V,E> implements HipsterDirectedGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> incomingEdgesOf(V vertex) { return graphTable.column(vertex).values(); } @Override GraphEdge<V,E> connect(V v1, V v2, E value); @Override Iterable<GraphEdge<V, E>> outgoing...
HashTableHipsterDirectedGraph extends HashTableHipsterGraph<V,E> implements HipsterDirectedGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> incomingEdgesOf(V vertex) { return graphTable.column(vertex).values(); } @Override GraphEdge<V,E> connect(V v1, V v2, E value); @Override Iterable<GraphEdge<V, E>> outgoing...
@Test public void testAdd() throws Exception { graph.add("G"); assertTrue(Sets.newHashSet(graph.vertices()).contains("G")); }
public void add(V v){ if (!graphTable.containsColumn(v) && !graphTable.containsRow(v)){ disconnected.add(v); } }
HashTableHipsterGraph implements HipsterGraph<V,E> { public void add(V v){ if (!graphTable.containsColumn(v) && !graphTable.containsRow(v)){ disconnected.add(v); } } }
HashTableHipsterGraph implements HipsterGraph<V,E> { public void add(V v){ if (!graphTable.containsColumn(v) && !graphTable.containsRow(v)){ disconnected.add(v); } } }
HashTableHipsterGraph implements HipsterGraph<V,E> { public void add(V v){ if (!graphTable.containsColumn(v) && !graphTable.containsRow(v)){ disconnected.add(v); } } void add(V v); void remove(V v); void remove(V v, GraphEdge<V,E> edge); GraphEdge<V,E> connect(V v1, V v2, E value); @Override Iterable<GraphEdge<V, E>> ...
HashTableHipsterGraph implements HipsterGraph<V,E> { public void add(V v){ if (!graphTable.containsColumn(v) && !graphTable.containsRow(v)){ disconnected.add(v); } } void add(V v); void remove(V v); void remove(V v, GraphEdge<V,E> edge); GraphEdge<V,E> connect(V v1, V v2, E value); @Override Iterable<GraphEdge<V, E>> ...
@Test public void testRemove() throws Exception { graph.remove("B"); assertFalse(Sets.newHashSet(graph.vertices()).contains("B")); }
public void remove(V v){ for(GraphEdge<V,E> edge : edgesOf(v)){ V connectedVertex = edge.getVertex1().equals(v) ? edge.getVertex2() : edge.getVertex1(); if (!greaterThan(1, edgesOf(connectedVertex))){ disconnected.add(connectedVertex); } } if (graphTable.containsRow(v)){ graphTable.row(v).clear(); } if (graphTable.cont...
HashTableHipsterGraph implements HipsterGraph<V,E> { public void remove(V v){ for(GraphEdge<V,E> edge : edgesOf(v)){ V connectedVertex = edge.getVertex1().equals(v) ? edge.getVertex2() : edge.getVertex1(); if (!greaterThan(1, edgesOf(connectedVertex))){ disconnected.add(connectedVertex); } } if (graphTable.containsRow(...
HashTableHipsterGraph implements HipsterGraph<V,E> { public void remove(V v){ for(GraphEdge<V,E> edge : edgesOf(v)){ V connectedVertex = edge.getVertex1().equals(v) ? edge.getVertex2() : edge.getVertex1(); if (!greaterThan(1, edgesOf(connectedVertex))){ disconnected.add(connectedVertex); } } if (graphTable.containsRow(...
HashTableHipsterGraph implements HipsterGraph<V,E> { public void remove(V v){ for(GraphEdge<V,E> edge : edgesOf(v)){ V connectedVertex = edge.getVertex1().equals(v) ? edge.getVertex2() : edge.getVertex1(); if (!greaterThan(1, edgesOf(connectedVertex))){ disconnected.add(connectedVertex); } } if (graphTable.containsRow(...
HashTableHipsterGraph implements HipsterGraph<V,E> { public void remove(V v){ for(GraphEdge<V,E> edge : edgesOf(v)){ V connectedVertex = edge.getVertex1().equals(v) ? edge.getVertex2() : edge.getVertex1(); if (!greaterThan(1, edgesOf(connectedVertex))){ disconnected.add(connectedVertex); } } if (graphTable.containsRow(...
@Test public void testConnect() throws Exception { graph.connect("X","Y",1.0d); assertTrue(Sets.newHashSet(graph.vertices()).contains("X")); assertTrue(Sets.newHashSet(graph.vertices()).contains("Y")); }
public GraphEdge<V,E> connect(V v1, V v2, E value){ Preconditions.checkArgument(v1 != null && v2 != null, "Vertices cannot be null"); GraphEdge<V,E> edge = new UndirectedEdge<V, E>(v1, v2, value); graphTable.put(v1, v2, edge); graphTable.put(v2, v1, edge); disconnected.remove(v1); disconnected.remove(v2); return edge; ...
HashTableHipsterGraph implements HipsterGraph<V,E> { public GraphEdge<V,E> connect(V v1, V v2, E value){ Preconditions.checkArgument(v1 != null && v2 != null, "Vertices cannot be null"); GraphEdge<V,E> edge = new UndirectedEdge<V, E>(v1, v2, value); graphTable.put(v1, v2, edge); graphTable.put(v2, v1, edge); disconnect...
HashTableHipsterGraph implements HipsterGraph<V,E> { public GraphEdge<V,E> connect(V v1, V v2, E value){ Preconditions.checkArgument(v1 != null && v2 != null, "Vertices cannot be null"); GraphEdge<V,E> edge = new UndirectedEdge<V, E>(v1, v2, value); graphTable.put(v1, v2, edge); graphTable.put(v2, v1, edge); disconnect...
HashTableHipsterGraph implements HipsterGraph<V,E> { public GraphEdge<V,E> connect(V v1, V v2, E value){ Preconditions.checkArgument(v1 != null && v2 != null, "Vertices cannot be null"); GraphEdge<V,E> edge = new UndirectedEdge<V, E>(v1, v2, value); graphTable.put(v1, v2, edge); graphTable.put(v2, v1, edge); disconnect...
HashTableHipsterGraph implements HipsterGraph<V,E> { public GraphEdge<V,E> connect(V v1, V v2, E value){ Preconditions.checkArgument(v1 != null && v2 != null, "Vertices cannot be null"); GraphEdge<V,E> edge = new UndirectedEdge<V, E>(v1, v2, value); graphTable.put(v1, v2, edge); graphTable.put(v2, v1, edge); disconnect...
@Test public void testEdges() throws Exception { Set<GraphEdge<String,Double>> expected = new HashSet<GraphEdge<String, Double>>(); expected.add(new UndirectedEdge<String, Double>("A","B",4d)); expected.add(new UndirectedEdge<String, Double>("A","C",2d)); expected.add(new UndirectedEdge<String, Double>("B","C",5d)); ex...
@Override public Iterable<GraphEdge<V, E>> edges() { return graphTable.values(); }
HashTableHipsterGraph implements HipsterGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edges() { return graphTable.values(); } }
HashTableHipsterGraph implements HipsterGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edges() { return graphTable.values(); } }
HashTableHipsterGraph implements HipsterGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edges() { return graphTable.values(); } void add(V v); void remove(V v); void remove(V v, GraphEdge<V,E> edge); GraphEdge<V,E> connect(V v1, V v2, E value); @Override Iterable<GraphEdge<V, E>> edges(); @Override Iterable<V>...
HashTableHipsterGraph implements HipsterGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edges() { return graphTable.values(); } void add(V v); void remove(V v); void remove(V v, GraphEdge<V,E> edge); GraphEdge<V,E> connect(V v1, V v2, E value); @Override Iterable<GraphEdge<V, E>> edges(); @Override Iterable<V>...
@Test public void testVertices() throws Exception { Set<String> expected = Sets.newHashSet("A","B","C","D","E","F"); assertEquals(expected, graph.vertices()); }
@Override public Iterable<V> vertices() { return Sets.union(Sets.union(graphTable.rowKeySet(), graphTable.columnKeySet()), disconnected); }
HashTableHipsterGraph implements HipsterGraph<V,E> { @Override public Iterable<V> vertices() { return Sets.union(Sets.union(graphTable.rowKeySet(), graphTable.columnKeySet()), disconnected); } }
HashTableHipsterGraph implements HipsterGraph<V,E> { @Override public Iterable<V> vertices() { return Sets.union(Sets.union(graphTable.rowKeySet(), graphTable.columnKeySet()), disconnected); } }
HashTableHipsterGraph implements HipsterGraph<V,E> { @Override public Iterable<V> vertices() { return Sets.union(Sets.union(graphTable.rowKeySet(), graphTable.columnKeySet()), disconnected); } void add(V v); void remove(V v); void remove(V v, GraphEdge<V,E> edge); GraphEdge<V,E> connect(V v1, V v2, E value); @Override...
HashTableHipsterGraph implements HipsterGraph<V,E> { @Override public Iterable<V> vertices() { return Sets.union(Sets.union(graphTable.rowKeySet(), graphTable.columnKeySet()), disconnected); } void add(V v); void remove(V v); void remove(V v, GraphEdge<V,E> edge); GraphEdge<V,E> connect(V v1, V v2, E value); @Override...
@Test public void testEdgesOf() throws Exception { Set<GraphEdge<String,Double>> expected = new HashSet<GraphEdge<String, Double>>(); expected.add(new UndirectedEdge<String, Double>("B","D",10d)); expected.add(new UndirectedEdge<String, Double>("A","B",4d)); expected.add(new UndirectedEdge<String, Double>("B","C",5d));...
@Override public Iterable<GraphEdge<V, E>> edgesOf(V vertex) { return Sets.union(Sets.newHashSet(graphTable.row(vertex).values()), Sets.newHashSet(graphTable.column(vertex).values())); }
HashTableHipsterGraph implements HipsterGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edgesOf(V vertex) { return Sets.union(Sets.newHashSet(graphTable.row(vertex).values()), Sets.newHashSet(graphTable.column(vertex).values())); } }
HashTableHipsterGraph implements HipsterGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edgesOf(V vertex) { return Sets.union(Sets.newHashSet(graphTable.row(vertex).values()), Sets.newHashSet(graphTable.column(vertex).values())); } }
HashTableHipsterGraph implements HipsterGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edgesOf(V vertex) { return Sets.union(Sets.newHashSet(graphTable.row(vertex).values()), Sets.newHashSet(graphTable.column(vertex).values())); } void add(V v); void remove(V v); void remove(V v, GraphEdge<V,E> edge); GraphEd...
HashTableHipsterGraph implements HipsterGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edgesOf(V vertex) { return Sets.union(Sets.newHashSet(graphTable.row(vertex).values()), Sets.newHashSet(graphTable.column(vertex).values())); } void add(V v); void remove(V v); void remove(V v, GraphEdge<V,E> edge); GraphEd...
@Test public void testEdges() throws Exception { testGraphEdges(); }
@Override public Iterable<GraphEdge<V, E>> edges() { return F.map(vedges(), new Function<Map.Entry<V, GraphEdge<V, E>>, GraphEdge<V, E>>() { @Override public GraphEdge<V, E> apply(Map.Entry<V, GraphEdge<V, E>> entry) { return entry.getValue(); } }); }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edges() { return F.map(vedges(), new Function<Map.Entry<V, GraphEdge<V, E>>, GraphEdge<V, E>>() { @Override public GraphEdge<V, E> apply(Map.Entry<V, GraphEdge<V, E>> entry) { return entry.getValue(); } }); } }
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edges() { return F.map(vedges(), new Function<Map.Entry<V, GraphEdge<V, E>>, GraphEdge<V, E>>() { @Override public GraphEdge<V, E> apply(Map.Entry<V, GraphEdge<V, E>> entry) { return entry.getValue(); } }); } HashBase...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edges() { return F.map(vedges(), new Function<Map.Entry<V, GraphEdge<V, E>>, GraphEdge<V, E>>() { @Override public GraphEdge<V, E> apply(Map.Entry<V, GraphEdge<V, E>> entry) { return entry.getValue(); } }); } HashBase...
HashBasedHipsterGraph implements HipsterMutableGraph<V,E> { @Override public Iterable<GraphEdge<V, E>> edges() { return F.map(vedges(), new Function<Map.Entry<V, GraphEdge<V, E>>, GraphEdge<V, E>>() { @Override public GraphEdge<V, E> apply(Map.Entry<V, GraphEdge<V, E>> entry) { return entry.getValue(); } }); } HashBase...
@Test public void getGasPriceWhenValueIsNull() throws Exception { Web3.CallArguments args = new Web3.CallArguments(); CallArgumentsToByteArray byteArrayArgs = new CallArgumentsToByteArray(args); Assert.assertArrayEquals(new byte[] {0}, byteArrayArgs.getGasPrice()); }
public byte[] getGasPrice() { byte[] gasPrice = new byte[] {0}; if (args.gasPrice != null && args.gasPrice.length() != 0) { gasPrice = stringHexToByteArray(args.gasPrice); } return gasPrice; }
CallArgumentsToByteArray { public byte[] getGasPrice() { byte[] gasPrice = new byte[] {0}; if (args.gasPrice != null && args.gasPrice.length() != 0) { gasPrice = stringHexToByteArray(args.gasPrice); } return gasPrice; } }
CallArgumentsToByteArray { public byte[] getGasPrice() { byte[] gasPrice = new byte[] {0}; if (args.gasPrice != null && args.gasPrice.length() != 0) { gasPrice = stringHexToByteArray(args.gasPrice); } return gasPrice; } CallArgumentsToByteArray(Web3.CallArguments args); }
CallArgumentsToByteArray { public byte[] getGasPrice() { byte[] gasPrice = new byte[] {0}; if (args.gasPrice != null && args.gasPrice.length() != 0) { gasPrice = stringHexToByteArray(args.gasPrice); } return gasPrice; } CallArgumentsToByteArray(Web3.CallArguments args); byte[] getGasPrice(); byte[] getGasLimit(); byte[...
CallArgumentsToByteArray { public byte[] getGasPrice() { byte[] gasPrice = new byte[] {0}; if (args.gasPrice != null && args.gasPrice.length() != 0) { gasPrice = stringHexToByteArray(args.gasPrice); } return gasPrice; } CallArgumentsToByteArray(Web3.CallArguments args); byte[] getGasPrice(); byte[] getGasLimit(); byte[...
@Test public void serializeLockWhitelist() throws Exception { byte[][] addressesBytes = new byte[][]{ BtcECKey.fromPrivate(BigInteger.valueOf(100)).getPubKeyHash(), BtcECKey.fromPrivate(BigInteger.valueOf(200)).getPubKeyHash(), BtcECKey.fromPrivate(BigInteger.valueOf(300)).getPubKeyHash(), BtcECKey.fromPrivate(BigInteg...
public static byte[] serializeOneOffLockWhitelist(Pair<List<OneOffWhiteListEntry>, Integer> data) { List<OneOffWhiteListEntry> entries = data.getLeft(); Integer disableBlockHeight = data.getRight(); int serializationSize = entries.size() * 2 + 1; byte[][] serializedLockWhitelist = new byte[serializationSize][]; for (in...
BridgeSerializationUtils { public static byte[] serializeOneOffLockWhitelist(Pair<List<OneOffWhiteListEntry>, Integer> data) { List<OneOffWhiteListEntry> entries = data.getLeft(); Integer disableBlockHeight = data.getRight(); int serializationSize = entries.size() * 2 + 1; byte[][] serializedLockWhitelist = new byte[se...
BridgeSerializationUtils { public static byte[] serializeOneOffLockWhitelist(Pair<List<OneOffWhiteListEntry>, Integer> data) { List<OneOffWhiteListEntry> entries = data.getLeft(); Integer disableBlockHeight = data.getRight(); int serializationSize = entries.size() * 2 + 1; byte[][] serializedLockWhitelist = new byte[se...
BridgeSerializationUtils { public static byte[] serializeOneOffLockWhitelist(Pair<List<OneOffWhiteListEntry>, Integer> data) { List<OneOffWhiteListEntry> entries = data.getLeft(); Integer disableBlockHeight = data.getRight(); int serializationSize = entries.size() * 2 + 1; byte[][] serializedLockWhitelist = new byte[se...
BridgeSerializationUtils { public static byte[] serializeOneOffLockWhitelist(Pair<List<OneOffWhiteListEntry>, Integer> data) { List<OneOffWhiteListEntry> entries = data.getLeft(); Integer disableBlockHeight = data.getRight(); int serializationSize = entries.size() * 2 + 1; byte[][] serializedLockWhitelist = new byte[se...
@Test public void deserializeOneOffLockWhitelistAndDisableBlockHeight() throws Exception { byte[][] addressesBytes = Arrays.asList(100, 200, 300, 400).stream() .map(k -> BtcECKey.fromPrivate(BigInteger.valueOf(k))) .sorted(BtcECKey.PUBKEY_COMPARATOR) .map(k -> k.getPubKeyHash()) .toArray(byte[][]::new); byte[][] rlpByt...
public static Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializeOneOffLockWhitelistAndDisableBlockHeight(byte[] data, NetworkParameters parameters) { if (data == null || data.length == 0) { return null; } RLPList rlpList = (RLPList)RLP.decode2(data).get(0); int serializedAddressesSize = rlpList.size() - ...
BridgeSerializationUtils { public static Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializeOneOffLockWhitelistAndDisableBlockHeight(byte[] data, NetworkParameters parameters) { if (data == null || data.length == 0) { return null; } RLPList rlpList = (RLPList)RLP.decode2(data).get(0); int serializedAddres...
BridgeSerializationUtils { public static Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializeOneOffLockWhitelistAndDisableBlockHeight(byte[] data, NetworkParameters parameters) { if (data == null || data.length == 0) { return null; } RLPList rlpList = (RLPList)RLP.decode2(data).get(0); int serializedAddres...
BridgeSerializationUtils { public static Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializeOneOffLockWhitelistAndDisableBlockHeight(byte[] data, NetworkParameters parameters) { if (data == null || data.length == 0) { return null; } RLPList rlpList = (RLPList)RLP.decode2(data).get(0); int serializedAddres...
BridgeSerializationUtils { public static Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializeOneOffLockWhitelistAndDisableBlockHeight(byte[] data, NetworkParameters parameters) { if (data == null || data.length == 0) { return null; } RLPList rlpList = (RLPList)RLP.decode2(data).get(0); int serializedAddres...
@Test public void deserializeOneOffLockWhitelistAndDisableBlockHeight_null() throws Exception { Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializedLockWhitelist = BridgeSerializationUtils.deserializeOneOffLockWhitelistAndDisableBlockHeight( null, NetworkParameters.fromID(NetworkParameters.ID_REGTEST) ); ...
public static Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializeOneOffLockWhitelistAndDisableBlockHeight(byte[] data, NetworkParameters parameters) { if (data == null || data.length == 0) { return null; } RLPList rlpList = (RLPList)RLP.decode2(data).get(0); int serializedAddressesSize = rlpList.size() - ...
BridgeSerializationUtils { public static Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializeOneOffLockWhitelistAndDisableBlockHeight(byte[] data, NetworkParameters parameters) { if (data == null || data.length == 0) { return null; } RLPList rlpList = (RLPList)RLP.decode2(data).get(0); int serializedAddres...
BridgeSerializationUtils { public static Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializeOneOffLockWhitelistAndDisableBlockHeight(byte[] data, NetworkParameters parameters) { if (data == null || data.length == 0) { return null; } RLPList rlpList = (RLPList)RLP.decode2(data).get(0); int serializedAddres...
BridgeSerializationUtils { public static Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializeOneOffLockWhitelistAndDisableBlockHeight(byte[] data, NetworkParameters parameters) { if (data == null || data.length == 0) { return null; } RLPList rlpList = (RLPList)RLP.decode2(data).get(0); int serializedAddres...
BridgeSerializationUtils { public static Pair<HashMap<Address, OneOffWhiteListEntry>, Integer> deserializeOneOffLockWhitelistAndDisableBlockHeight(byte[] data, NetworkParameters parameters) { if (data == null || data.length == 0) { return null; } RLPList rlpList = (RLPList)RLP.decode2(data).get(0); int serializedAddres...
@Test public void serializeRequestQueue() throws Exception { List<ReleaseRequestQueue.Entry> sampleEntries = Arrays.asList( new ReleaseRequestQueue.Entry(mockAddressHash160("ccdd"), Coin.valueOf(10)), new ReleaseRequestQueue.Entry(mockAddressHash160("bb"), Coin.valueOf(50)), new ReleaseRequestQueue.Entry(mockAddressHas...
public static byte[] serializeReleaseRequestQueue(ReleaseRequestQueue queue) { List<ReleaseRequestQueue.Entry> entries = queue.getEntriesWithoutHash(); byte[][] bytes = new byte[entries.size() * 2][]; int n = 0; for (ReleaseRequestQueue.Entry entry : entries) { bytes[n++] = RLP.encodeElement(entry.getDestination().getH...
BridgeSerializationUtils { public static byte[] serializeReleaseRequestQueue(ReleaseRequestQueue queue) { List<ReleaseRequestQueue.Entry> entries = queue.getEntriesWithoutHash(); byte[][] bytes = new byte[entries.size() * 2][]; int n = 0; for (ReleaseRequestQueue.Entry entry : entries) { bytes[n++] = RLP.encodeElement(...
BridgeSerializationUtils { public static byte[] serializeReleaseRequestQueue(ReleaseRequestQueue queue) { List<ReleaseRequestQueue.Entry> entries = queue.getEntriesWithoutHash(); byte[][] bytes = new byte[entries.size() * 2][]; int n = 0; for (ReleaseRequestQueue.Entry entry : entries) { bytes[n++] = RLP.encodeElement(...
BridgeSerializationUtils { public static byte[] serializeReleaseRequestQueue(ReleaseRequestQueue queue) { List<ReleaseRequestQueue.Entry> entries = queue.getEntriesWithoutHash(); byte[][] bytes = new byte[entries.size() * 2][]; int n = 0; for (ReleaseRequestQueue.Entry entry : entries) { bytes[n++] = RLP.encodeElement(...
BridgeSerializationUtils { public static byte[] serializeReleaseRequestQueue(ReleaseRequestQueue queue) { List<ReleaseRequestQueue.Entry> entries = queue.getEntriesWithoutHash(); byte[][] bytes = new byte[entries.size() * 2][]; int n = 0; for (ReleaseRequestQueue.Entry entry : entries) { bytes[n++] = RLP.encodeElement(...
@Test public void deserializeRequestQueue_emptyOrNull() throws Exception { assertEquals(0, BridgeSerializationUtils.deserializeReleaseRequestQueue(null, NetworkParameters.fromID(NetworkParameters.ID_REGTEST)).size()); assertEquals(0, BridgeSerializationUtils.deserializeReleaseRequestQueue(new byte[]{}, NetworkParameter...
public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); }
BridgeSerializationUtils { public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); } }
BridgeSerializationUtils { public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); } private BridgeSerializationUtils(); }
BridgeSerializationUtils { public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTra...
BridgeSerializationUtils { public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTra...
@Test public void deserializeRequestQueue_nonEmpty() throws Exception { NetworkParameters params = NetworkParameters.fromID(NetworkParameters.ID_REGTEST); Address a1 = Address.fromBase58(params, "mynmcQfJnVjheAqh9XL6htnxPZnaDFbqkB"); Address a2 = Address.fromBase58(params, "mfrfxeo5L2f5NDURS6YTtCNfVw2t5HAfty"); Address...
public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); }
BridgeSerializationUtils { public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); } }
BridgeSerializationUtils { public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); } private BridgeSerializationUtils(); }
BridgeSerializationUtils { public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTra...
BridgeSerializationUtils { public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTra...
@Test public void deserializeRequestQueue_nonEmptyOddSize() throws Exception { NetworkParameters params = NetworkParameters.fromID(NetworkParameters.ID_REGTEST); Address a1 = Address.fromBase58(params, "mynmcQfJnVjheAqh9XL6htnxPZnaDFbqkB"); Address a2 = Address.fromBase58(params, "mfrfxeo5L2f5NDURS6YTtCNfVw2t5HAfty"); ...
public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); }
BridgeSerializationUtils { public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); } }
BridgeSerializationUtils { public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); } private BridgeSerializationUtils(); }
BridgeSerializationUtils { public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTra...
BridgeSerializationUtils { public static List<ReleaseRequestQueue.Entry> deserializeReleaseRequestQueue(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseRequestQueue(data, networkParameters, false); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTra...
@Test public void serializeTransactionSet() throws Exception { Set<ReleaseTransactionSet.Entry> sampleEntries = new HashSet<>(Arrays.asList( new ReleaseTransactionSet.Entry(mockBtcTransactionSerialize("ccdd"), 10L), new ReleaseTransactionSet.Entry(mockBtcTransactionSerialize("bb"), 20L), new ReleaseTransactionSet.Entry...
public static byte[] serializeReleaseTransactionSet(ReleaseTransactionSet set) { List<ReleaseTransactionSet.Entry> entries = set.getEntriesWithoutHash().stream().collect(Collectors.toList()); entries.sort(ReleaseTransactionSet.Entry.BTC_TX_COMPARATOR); byte[][] bytes = new byte[entries.size() * 2][]; int n = 0; for (Re...
BridgeSerializationUtils { public static byte[] serializeReleaseTransactionSet(ReleaseTransactionSet set) { List<ReleaseTransactionSet.Entry> entries = set.getEntriesWithoutHash().stream().collect(Collectors.toList()); entries.sort(ReleaseTransactionSet.Entry.BTC_TX_COMPARATOR); byte[][] bytes = new byte[entries.size()...
BridgeSerializationUtils { public static byte[] serializeReleaseTransactionSet(ReleaseTransactionSet set) { List<ReleaseTransactionSet.Entry> entries = set.getEntriesWithoutHash().stream().collect(Collectors.toList()); entries.sort(ReleaseTransactionSet.Entry.BTC_TX_COMPARATOR); byte[][] bytes = new byte[entries.size()...
BridgeSerializationUtils { public static byte[] serializeReleaseTransactionSet(ReleaseTransactionSet set) { List<ReleaseTransactionSet.Entry> entries = set.getEntriesWithoutHash().stream().collect(Collectors.toList()); entries.sort(ReleaseTransactionSet.Entry.BTC_TX_COMPARATOR); byte[][] bytes = new byte[entries.size()...
BridgeSerializationUtils { public static byte[] serializeReleaseTransactionSet(ReleaseTransactionSet set) { List<ReleaseTransactionSet.Entry> entries = set.getEntriesWithoutHash().stream().collect(Collectors.toList()); entries.sort(ReleaseTransactionSet.Entry.BTC_TX_COMPARATOR); byte[][] bytes = new byte[entries.size()...
@Test public void deserializeTransactionSet_emptyOrNull() throws Exception { assertEquals(0, BridgeSerializationUtils.deserializeReleaseTransactionSet(null, NetworkParameters.fromID(NetworkParameters.ID_REGTEST)).getEntries().size()); assertEquals(0, BridgeSerializationUtils.deserializeReleaseTransactionSet(new byte[]{...
public static ReleaseTransactionSet deserializeReleaseTransactionSet(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseTransactionSet(data, networkParameters, false); }
BridgeSerializationUtils { public static ReleaseTransactionSet deserializeReleaseTransactionSet(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseTransactionSet(data, networkParameters, false); } }
BridgeSerializationUtils { public static ReleaseTransactionSet deserializeReleaseTransactionSet(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseTransactionSet(data, networkParameters, false); } private BridgeSerializationUtils(); }
BridgeSerializationUtils { public static ReleaseTransactionSet deserializeReleaseTransactionSet(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseTransactionSet(data, networkParameters, false); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTransacti...
BridgeSerializationUtils { public static ReleaseTransactionSet deserializeReleaseTransactionSet(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseTransactionSet(data, networkParameters, false); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTransacti...
@Test public void deserializeTransactionSet_nonEmptyOddSize() throws Exception { byte[] firstItem = RLP.encodeElement(Hex.decode("010203")); byte[] data = RLP.encodeList(firstItem); try { BridgeSerializationUtils.deserializeReleaseTransactionSet(data, NetworkParameters.fromID(NetworkParameters.ID_REGTEST)); } catch (Ru...
public static ReleaseTransactionSet deserializeReleaseTransactionSet(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseTransactionSet(data, networkParameters, false); }
BridgeSerializationUtils { public static ReleaseTransactionSet deserializeReleaseTransactionSet(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseTransactionSet(data, networkParameters, false); } }
BridgeSerializationUtils { public static ReleaseTransactionSet deserializeReleaseTransactionSet(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseTransactionSet(data, networkParameters, false); } private BridgeSerializationUtils(); }
BridgeSerializationUtils { public static ReleaseTransactionSet deserializeReleaseTransactionSet(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseTransactionSet(data, networkParameters, false); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTransacti...
BridgeSerializationUtils { public static ReleaseTransactionSet deserializeReleaseTransactionSet(byte[] data, NetworkParameters networkParameters) { return deserializeReleaseTransactionSet(data, networkParameters, false); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTransacti...
@Test public void isEmpty_Array() { Value val = new Value(new String[0]); assertTrue(val.isEmpty()); }
public boolean isEmpty() { if (isNull()) { return true; } if (isBytes() && asBytes().length == 0) { return true; } if (isList() && asList().isEmpty()) { return true; } if (isString() && asString().equals("")) { return true; } return false; }
Value { public boolean isEmpty() { if (isNull()) { return true; } if (isBytes() && asBytes().length == 0) { return true; } if (isList() && asList().isEmpty()) { return true; } if (isString() && asString().equals("")) { return true; } return false; } }
Value { public boolean isEmpty() { if (isNull()) { return true; } if (isBytes() && asBytes().length == 0) { return true; } if (isList() && asList().isEmpty()) { return true; } if (isString() && asString().equals("")) { return true; } return false; } Value(); Value(Object obj); }
Value { public boolean isEmpty() { if (isNull()) { return true; } if (isBytes() && asBytes().length == 0) { return true; } if (isList() && asList().isEmpty()) { return true; } if (isString() && asString().equals("")) { return true; } return false; } Value(); Value(Object obj); static Value fromRlpEncoded(byte[] data);...
Value { public boolean isEmpty() { if (isNull()) { return true; } if (isBytes() && asBytes().length == 0) { return true; } if (isList() && asList().isEmpty()) { return true; } if (isString() && asString().equals("")) { return true; } return false; } Value(); Value(Object obj); static Value fromRlpEncoded(byte[] data);...
@Test public void serializeInteger() { Assert.assertEquals(BigInteger.valueOf(123), RLP.decodeBigInteger(BridgeSerializationUtils.serializeInteger(123), 0)); Assert.assertEquals(BigInteger.valueOf(1200), RLP.decodeBigInteger(BridgeSerializationUtils.serializeInteger(1200), 0)); }
public static byte[] serializeInteger(Integer value) { return RLP.encodeBigInteger(BigInteger.valueOf(value)); }
BridgeSerializationUtils { public static byte[] serializeInteger(Integer value) { return RLP.encodeBigInteger(BigInteger.valueOf(value)); } }
BridgeSerializationUtils { public static byte[] serializeInteger(Integer value) { return RLP.encodeBigInteger(BigInteger.valueOf(value)); } private BridgeSerializationUtils(); }
BridgeSerializationUtils { public static byte[] serializeInteger(Integer value) { return RLP.encodeBigInteger(BigInteger.valueOf(value)); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTransaction> map); static SortedMap<Keccak256, BtcTransaction> deserializeMap(byte[] data, N...
BridgeSerializationUtils { public static byte[] serializeInteger(Integer value) { return RLP.encodeBigInteger(BigInteger.valueOf(value)); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTransaction> map); static SortedMap<Keccak256, BtcTransaction> deserializeMap(byte[] data, N...
@Test public void deserializeInteger() { Assert.assertEquals(123, BridgeSerializationUtils.deserializeInteger(RLP.encodeBigInteger(BigInteger.valueOf(123))).intValue()); Assert.assertEquals(1200, BridgeSerializationUtils.deserializeInteger(RLP.encodeBigInteger(BigInteger.valueOf(1200))).intValue()); }
public static Integer deserializeInteger(byte[] data) { return RLP.decodeBigInteger(data, 0).intValue(); }
BridgeSerializationUtils { public static Integer deserializeInteger(byte[] data) { return RLP.decodeBigInteger(data, 0).intValue(); } }
BridgeSerializationUtils { public static Integer deserializeInteger(byte[] data) { return RLP.decodeBigInteger(data, 0).intValue(); } private BridgeSerializationUtils(); }
BridgeSerializationUtils { public static Integer deserializeInteger(byte[] data) { return RLP.decodeBigInteger(data, 0).intValue(); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTransaction> map); static SortedMap<Keccak256, BtcTransaction> deserializeMap(byte[] data, Network...
BridgeSerializationUtils { public static Integer deserializeInteger(byte[] data) { return RLP.decodeBigInteger(data, 0).intValue(); } private BridgeSerializationUtils(); static byte[] serializeMap(SortedMap<Keccak256, BtcTransaction> map); static SortedMap<Keccak256, BtcTransaction> deserializeMap(byte[] data, Network...
@Test public void getSize() { Assert.assertEquals(4, whitelist.getSize().intValue()); }
public Integer getSize() { return whitelistedAddresses.size(); }
LockWhitelist { public Integer getSize() { return whitelistedAddresses.size(); } }
LockWhitelist { public Integer getSize() { return whitelistedAddresses.size(); } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses, int disableBlockHeight); }
LockWhitelist { public Integer getSize() { return whitelistedAddresses.size(); } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses, int disableBlockHeight); boolean isWhitelisted(Address address); boolean isWhitelisted(byte[] addre...
LockWhitelist { public Integer getSize() { return whitelistedAddresses.size(); } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses, int disableBlockHeight); boolean isWhitelisted(Address address); boolean isWhitelisted(byte[] addre...
@Test public void getAddresses() { Assert.assertNotSame(whitelist.getAddresses(), addresses); Assert.assertThat(whitelist.getAddresses(), containsInAnyOrder(addresses.keySet().toArray())); }
public List<Address> getAddresses() { return new ArrayList<>(whitelistedAddresses.keySet()); }
LockWhitelist { public List<Address> getAddresses() { return new ArrayList<>(whitelistedAddresses.keySet()); } }
LockWhitelist { public List<Address> getAddresses() { return new ArrayList<>(whitelistedAddresses.keySet()); } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses, int disableBlockHeight); }
LockWhitelist { public List<Address> getAddresses() { return new ArrayList<>(whitelistedAddresses.keySet()); } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses, int disableBlockHeight); boolean isWhitelisted(Address address); bool...
LockWhitelist { public List<Address> getAddresses() { return new ArrayList<>(whitelistedAddresses.keySet()); } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses, int disableBlockHeight); boolean isWhitelisted(Address address); bool...
@Test public void isWhitelisted() { for (Address address : addresses.keySet()) { assertExistance(address, true); } Address randomAddress = Address.fromBase58( NetworkParameters.fromID(NetworkParameters.ID_REGTEST), "n3PLxDiwWqa5uH7fSbHCxS6VAjD9Y7Rwkj" ); assertExistance(randomAddress, false); }
public boolean isWhitelisted(Address address) { return whitelistedAddresses.containsKey(address); }
LockWhitelist { public boolean isWhitelisted(Address address) { return whitelistedAddresses.containsKey(address); } }
LockWhitelist { public boolean isWhitelisted(Address address) { return whitelistedAddresses.containsKey(address); } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses, int disableBlockHeight); }
LockWhitelist { public boolean isWhitelisted(Address address) { return whitelistedAddresses.containsKey(address); } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses, int disableBlockHeight); boolean isWhitelisted(Address address);...
LockWhitelist { public boolean isWhitelisted(Address address) { return whitelistedAddresses.containsKey(address); } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses, int disableBlockHeight); boolean isWhitelisted(Address address);...
@Test public void addOneOff() { Address randomAddress = Address.fromBase58( NetworkParameters.fromID(NetworkParameters.ID_REGTEST), "n3WzdjG7S2GjDbY1pJYxsY1VSQDkm4KDcm" ); assertExistance(randomAddress, false); Assert.assertTrue(whitelist.put(randomAddress, new OneOffWhiteListEntry(randomAddress, Coin.CENT))); assertEx...
public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; }
LockWhitelist { public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; } }
LockWhitelist { public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> ...
LockWhitelist { public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> ...
LockWhitelist { public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> ...
@Test public void addUnlimited() { Address randomAddress = Address.fromBase58( NetworkParameters.fromID(NetworkParameters.ID_REGTEST), "n3WzdjG7S2GjDbY1pJYxsY1VSQDkm4KDcm" ); assertExistance(randomAddress, false); Assert.assertTrue(whitelist.put(randomAddress, new UnlimitedWhiteListEntry(randomAddress))); assertExistan...
public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; }
LockWhitelist { public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; } }
LockWhitelist { public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> ...
LockWhitelist { public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> ...
LockWhitelist { public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> ...
@Test public void addOneOffAfterUnlimited() { Address randomAddress = Address.fromBase58( NetworkParameters.fromID(NetworkParameters.ID_REGTEST), "n3WzdjG7S2GjDbY1pJYxsY1VSQDkm4KDcm" ); assertExistance(randomAddress, false); Assert.assertTrue(whitelist.put(randomAddress, new UnlimitedWhiteListEntry(randomAddress))); as...
public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; }
LockWhitelist { public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; } }
LockWhitelist { public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> ...
LockWhitelist { public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> ...
LockWhitelist { public boolean put(Address address, LockWhitelistEntry entry) { if (whitelistedAddresses.containsKey(address)) { return false; } whitelistedAddresses.put(address, entry); return true; } LockWhitelist(Map<Address, LockWhitelistEntry> whitelistedAddresses); LockWhitelist(Map<Address, LockWhitelistEntry> ...