@Test(expected = IllegalArgumentException.class) public void zeroLease() { LeaseRequestResult.leaseGranted(0L); }
public static LeaseRequestResult leaseGranted(long leaseLength) { if (leaseLength <= 0) { throw new IllegalArgumentException("Granting a non-positive length lease is not allowed: " + leaseLength); } return new LeaseRequestResult(true, true, leaseLength); }
LeaseRequestResult implements LeaseResponse { public static LeaseRequestResult leaseGranted(long leaseLength) { if (leaseLength <= 0) { throw new IllegalArgumentException("Granting a non-positive length lease is not allowed: " + leaseLength); } return new LeaseRequestResult(true, true, leaseLength); } }
LeaseRequestResult implements LeaseResponse { public static LeaseRequestResult leaseGranted(long leaseLength) { if (leaseLength <= 0) { throw new IllegalArgumentException("Granting a non-positive length lease is not allowed: " + leaseLength); } return new LeaseRequestResult(true, true, leaseLength); } private  LeaseRequestResult(boolean connectionGood, boolean leaseGranted, long leaseLength); }
LeaseRequestResult implements LeaseResponse { public static LeaseRequestResult leaseGranted(long leaseLength) { if (leaseLength <= 0) { throw new IllegalArgumentException("Granting a non-positive length lease is not allowed: " + leaseLength); } return new LeaseRequestResult(true, true, leaseLength); } private  LeaseRequestResult(boolean connectionGood, boolean leaseGranted, long leaseLength); static LeaseRequestResult leaseNotGranted(); static LeaseRequestResult leaseGranted(long leaseLength); static LeaseRequestResult oldConnection(); boolean isConnectionGood(); boolean isLeaseGranted(); long getLeaseLength(); @Override LeaseResponseType getType(); static void addStruct(StructBuilder parentBuilder, int index); @Override void encode(StructEncoder<Void> parentEncoder); static LeaseResponse decode(StructDecoder<Void> parentDecoder); }
LeaseRequestResult implements LeaseResponse { public static LeaseRequestResult leaseGranted(long leaseLength) { if (leaseLength <= 0) { throw new IllegalArgumentException("Granting a non-positive length lease is not allowed: " + leaseLength); } return new LeaseRequestResult(true, true, leaseLength); } private  LeaseRequestResult(boolean connectionGood, boolean leaseGranted, long leaseLength); static LeaseRequestResult leaseNotGranted(); static LeaseRequestResult leaseGranted(long leaseLength); static LeaseRequestResult oldConnection(); boolean isConnectionGood(); boolean isLeaseGranted(); long getLeaseLength(); @Override LeaseResponseType getType(); static void addStruct(StructBuilder parentBuilder, int index); @Override void encode(StructEncoder<Void> parentEncoder); static LeaseResponse decode(StructDecoder<Void> parentDecoder);  }