@Test public void testValid() { ExtendedPanId address = new ExtendedPanId("17880100dc880b"); assertTrue(address.isValid()); address = new ExtendedPanId(); assertFalse(address.isValid()); address = new ExtendedPanId("0000000000000000"); assertFalse(address.isValid()); address = new ExtendedPanId("FFFFFFFFFFFFFFFF"); assertFalse(address.isValid()); }
public boolean isValid() { if (panId == null || panId.length != 8) { return false; } int cnt0 = 0; int cntF = 0; for (int val : panId) { if (val == 0x00) { cnt0++; } if (val == 0xFF) { cntF++; } } return !(cnt0 == 8 || cntF == 8); }
ExtendedPanId { public boolean isValid() { if (panId == null || panId.length != 8) { return false; } int cnt0 = 0; int cntF = 0; for (int val : panId) { if (val == 0x00) { cnt0++; } if (val == 0xFF) { cntF++; } } return !(cnt0 == 8 || cntF == 8); } }
ExtendedPanId { public boolean isValid() { if (panId == null || panId.length != 8) { return false; } int cnt0 = 0; int cntF = 0; for (int val : panId) { if (val == 0x00) { cnt0++; } if (val == 0xFF) { cntF++; } } return !(cnt0 == 8 || cntF == 8); } ExtendedPanId();  ExtendedPanId(BigInteger panId);  ExtendedPanId(String panId);  ExtendedPanId(int[] panId); }
ExtendedPanId { public boolean isValid() { if (panId == null || panId.length != 8) { return false; } int cnt0 = 0; int cntF = 0; for (int val : panId) { if (val == 0x00) { cnt0++; } if (val == 0xFF) { cntF++; } } return !(cnt0 == 8 || cntF == 8); } ExtendedPanId();  ExtendedPanId(BigInteger panId);  ExtendedPanId(String panId);  ExtendedPanId(int[] panId); int[] getValue(); boolean isValid(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static ExtendedPanId createRandom(); }
ExtendedPanId { public boolean isValid() { if (panId == null || panId.length != 8) { return false; } int cnt0 = 0; int cntF = 0; for (int val : panId) { if (val == 0x00) { cnt0++; } if (val == 0xFF) { cntF++; } } return !(cnt0 == 8 || cntF == 8); } ExtendedPanId();  ExtendedPanId(BigInteger panId);  ExtendedPanId(String panId);  ExtendedPanId(int[] panId); int[] getValue(); boolean isValid(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static ExtendedPanId createRandom();  }