@Test public void testValid() { ZigBeeKey key = new ZigBeeKey("11223344556677889900AABBCCDDEEFF"); assertTrue(key.isValid()); key = new ZigBeeKey("00000000000000000000000000000000"); assertFalse(key.isValid()); }
public boolean isValid() { if (key == null || key.length != 16) { return false; } int cnt0 = 0; for (int val : key) { if (val == 0x00) { cnt0++; } } return (cnt0 != 16); }
ZigBeeKey { public boolean isValid() { if (key == null || key.length != 16) { return false; } int cnt0 = 0; for (int val : key) { if (val == 0x00) { cnt0++; } } return (cnt0 != 16); } }
ZigBeeKey { public boolean isValid() { if (key == null || key.length != 16) { return false; } int cnt0 = 0; for (int val : key) { if (val == 0x00) { cnt0++; } } return (cnt0 != 16); } ZigBeeKey();  ZigBeeKey(String key);  ZigBeeKey(int[] key); }
ZigBeeKey { public boolean isValid() { if (key == null || key.length != 16) { return false; } int cnt0 = 0; for (int val : key) { if (val == 0x00) { cnt0++; } } return (cnt0 != 16); } ZigBeeKey();  ZigBeeKey(String key);  ZigBeeKey(int[] key); int[] getValue(); boolean hasIncomingFrameCounter(); boolean hasOutgoingFrameCounter(); boolean hasSequenceNumber(); boolean hasAddress(); IeeeAddress getAddress(); void setAddress(IeeeAddress address); Integer getIncomingFrameCounter(); void setIncomingFrameCounter(Integer counter); Integer getOutgoingFrameCounter(); void setOutgoingFrameCounter(Integer counter); Integer getSequenceNumber(); void setSequenceNumber(Integer counter); boolean isValid(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static ZigBeeKey createRandom(); }
ZigBeeKey { public boolean isValid() { if (key == null || key.length != 16) { return false; } int cnt0 = 0; for (int val : key) { if (val == 0x00) { cnt0++; } } return (cnt0 != 16); } ZigBeeKey();  ZigBeeKey(String key);  ZigBeeKey(int[] key); int[] getValue(); boolean hasIncomingFrameCounter(); boolean hasOutgoingFrameCounter(); boolean hasSequenceNumber(); boolean hasAddress(); IeeeAddress getAddress(); void setAddress(IeeeAddress address); Integer getIncomingFrameCounter(); void setIncomingFrameCounter(Integer counter); Integer getOutgoingFrameCounter(); void setOutgoingFrameCounter(Integer counter); Integer getSequenceNumber(); void setSequenceNumber(Integer counter); boolean isValid(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static ZigBeeKey createRandom();  }