com.spring.boxes.redis.lock.support.SimpleLockResult Maven / Gradle / Ivy
The newest version!
package com.spring.boxes.redis.lock.support;
import com.spring.boxes.redis.lock.LockResult;
import java.util.Optional;
public class SimpleLockResult implements LockResult {
private boolean success;
private T returnValue;
public SimpleLockResult() {
}
public SimpleLockResult(boolean success, T returnValue) {
this.success = success;
this.returnValue = returnValue;
}
public void setSuccess(boolean success) {
this.success = success;
}
public void setReturnValue(T returnValue) {
this.returnValue = returnValue;
}
@Override
public boolean isSuccess() {
return success;
}
@Override
public Optional getReturnValue() {
return Optional.of(returnValue);
}
}