code: @PUT
      @Consumes(MediaType.APPLICATION_JSON)
      @Produces(MediaType.APPLICATION_JSON)
      public @Nullable KeyValue update(SetValue setValue) throws Exception {
          if (!setValue.hasNewValue() && !setValue.hasExpectedValue()) {
              throw new IllegalArgumentException(String.format("key:%s - bad request: expectedValue and newValue not set", key));
          }
  
          if (setValue.hasExpectedValue()) {
              return compareAndSet(setValue);
          } else {
              return set(setValue);
          }
      }
docs: Perform a {@code SET} or {@code CAS} on the {@link KeyResource#key} represented by this resource.
  <p/>
  The rules for {@code SET} and {@code CAS} are
  described in the KayVee README.md. Additional validation of
  {@code setValue} is performed to ensure that its
  fields meet the preconditions for these operations.
  
  @param setValue valid instance of {@code SetValue} with fields set
  appropriately for the invoked operation
  @return new value associated with the {@link KeyResource#key} represented by this resource.
  May be null if this key was deleted from replicated storage
  @throws CannotSubmitCommandException if this server is not the
  leader of the Raft cluster and cannot submit commands to the cluster
  @throws Exception if this operation cannot be replicated to the Raft cluster. If an exception is
  thrown this operation is in an <strong>unknown</strong> state, and should be retried
  
  @see KayVeeCommand