public static Stella_Object accessKvConsSlotValue(KvCons self, Symbol slotname, Stella_Object value, boolean setvalueP) {
    if (slotname == Stella.SYM_STELLA_KEY) {
      if (setvalueP) {
        self.key = value;
      }
      else {
        value = self.key;
      }
    }
    else if (slotname == Stella.SYM_STELLA_VALUE) {
      if (setvalueP) {
        self.value = value;
      }
      else {
        value = self.value;
      }
    }
    else if (slotname == Stella.SYM_STELLA_REST) {
      if (setvalueP) {
        self.rest = ((KvCons)(value));
      }
      else {
        value = self.rest;
      }
    }
    else {
      { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

        stream000.nativeStream.print("`" + slotname + "' is not a valid case option");
        throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
      }
    }
    return (value);
  }