compareAndSet value field.
544467
boolean casValue(Object cmp, Object val) {
            return U.compareAndSwapObject(this, VALUE, cmp, val);
        }
292941
public boolean compareNextToField(FieldInfo field)   // Must be to call right Get calls
    {
        Object objNext = this.getNextData();
        if (objNext == DATA_ERROR)
            return false;  // EOF
        if (objNext == DATA_EOF)
            return false;  // EOF
        if (objNext == DATA_SKIP)
            return true;  // Don't set this field
        Object objField = field.getData();
        if ((objNext == null) || (objField == null))
        {
            if ((objNext == null) && (objField == null))
                return true;
            return false;
        }
        return objNext.equals(objField);
    }
740323
def validate_attr(self, append):
        """"""
        if append:
            existing_fields = getattr(self.attrs, self.kind_attr, None)
            if (existing_fields is not None and
                    existing_fields != list(self.values)):
                raise ValueError("appended items do not match existing items"
                                 " in table!")

            existing_dtype = getattr(self.attrs, self.dtype_attr, None)
            if (existing_dtype is not None and
                    existing_dtype != self.dtype):
                raise ValueError("appended items dtype do not match existing "
                                 "items dtype in table!")
1309397
def validate_value(self, value):
        """"""
        super(ValuesListField, self).validate_value(value)

        if value is not None:
            if value not in self.selection_to_id_map:
                raise ValidationError(
                    self.record,
                    'Field "{}" invalid value "{}". Valid options: {}'.format(
                        self.name,
                        value,
                        ', '.join(self.selection_to_id_map.keys())
                    )
                )
23180
function ruleExistsFieldValueEqual($tablename, $field, $value, $error_message = null) {
        return $this->ruleExists($tablename, $field, $value, $error_message);
    }
748175
def ldSet(self, what, key, value):
    """"""
    if isListKey(key):
      # Make sure we keep the indexes consistent, insert missing_values
      # as necessary. We do remember the lists, so that we can remove
      # missing values after inserting all values from all selectors.
      self.lists[id(what)] = what
      ix = listKeyIndex(key)
      while len(what) <= ix:
        what.append(missing_value)
      what[ix] = value
    else:
      what[key] = value
    return value
1053919
public final boolean compareAndSet(int i, int expect, int update) {
        if (fullWidth) {
            return array.compareAndSet(i, expect, update);
        }

        boolean success = false;
        int index = getIndex(i);
        int subIndex = getSubIndex(i);
        while (!success) {
            int prev = array.get(index);
            if (unPack(prev, subIndex) != expect) {
                return false;
            }

            int next = pack(prev, update, subIndex);
            success = array.compareAndSet(index, prev, next);
        }
        return true;
    }
695186
private void filter(ValueSet filterValueSet, ValueSet valueSet) {
        if (filterValueSet != null && valueSet != null && !filterValueSet.isEmpty() && !valueSet.isEmpty()) {
            Iterator it = filterValueSet.iterator();
            while (it.hasNext()) {
                Object o = it.next();
                if (valueSet.contains(o)) {
                    it.remove();
                }
            }
        }
    }
393099
public T getAndSet(T value) {
        T t = this.value;
        this.value = value;
        return t;
    }
654931
def check_value(self, value):
        """"""
        #if self.readonly:
        #    raise error.Error(
        #        "'{field_name}' field is readonly".format(
        #            field_name=self.name))
        if value and self.size:
            if not is_string(value):
                raise ValueError("Value supplied has to be a string")
            if len(value) > self.size:
                raise ValueError(
                    "Lenght of the '{0}' is limited to {1}".format(
                        self.name, self.size))
        if not value and self.required:
            raise ValueError("'{0}' field is required".format(self.name))
        return value
1172107
public ZealotKhala andNotEqual(String field, Object value) {
        return this.doNormal(ZealotConst.AND_PREFIX, field, value, ZealotConst.NOT_EQUAL_SUFFIX, true);
    }
659261
def __check_field(self, key):
        """"""
        if not self._props.get(key):
            raise KeyError(
                'The field "%s" does not exist on "%s"' % (
                    key, self.__class__.__name__,
                ),
            )
123817
private static void compareSets(Delta delta, Collection deltas, LinkedList stack, ID idFetcher)
    {
        Set srcSet = (Set) delta.srcValue;
        Set targetSet = (Set) delta.targetValue;

        // Create ID to Object map for target Set
        Map targetIdToValue = new HashMap();
        for (Object targetValue : targetSet)
        {
            if (targetValue != null && isIdObject(targetValue, idFetcher))
            {   // Only map non-null target array elements
                targetIdToValue.put(idFetcher.getId(targetValue), targetValue);
            }
        }

        Map srcIdToValue = new HashMap();
        String sysId = "(" + System.identityHashCode(srcSet) + ").remove(";
        for (Object srcValue : srcSet)
        {
            String srcPtr = sysId + System.identityHashCode(srcValue) + ')';
            if (isIdObject(srcValue, idFetcher))
            {   // Only map non-null source array elements
                Object srcId = idFetcher.getId(srcValue);
                srcIdToValue.put(srcId, srcValue);

                if (targetIdToValue.containsKey(srcId))
                {   // Queue item for deep, field level check as the object is still there (it's fields could have changed).
                    stack.push(new Delta(delta.id, delta.fieldName, srcPtr, srcValue, targetIdToValue.get(srcId), null));
                }
                else
                {
                    Delta removeDelta = new Delta(delta.id, delta.fieldName, srcPtr, srcValue, null, null);
                    removeDelta.setCmd(SET_REMOVE);
                    deltas.add(removeDelta);
                }
            }
            else
            {
                if (!targetSet.contains(srcValue))
                {
                    Delta removeDelta = new Delta(delta.id, delta.fieldName, srcPtr, srcValue, null, null);
                    removeDelta.setCmd(SET_REMOVE);
                    deltas.add(removeDelta);
                }
            }
        }

        sysId = "(" + System.identityHashCode(targetSet) + ").add(";
        for (Object targetValue : targetSet)
        {
            String srcPtr = sysId + System.identityHashCode(targetValue) + ')';
            if (isIdObject(targetValue, idFetcher))
            {
                Object targetId = idFetcher.getId(targetValue);
                if (!srcIdToValue.containsKey(targetId))
                {
                    Delta addDelta = new Delta(delta.id, delta.fieldName, srcPtr, null, targetValue, null);
                    addDelta.setCmd(SET_ADD);
                    deltas.add(addDelta);
                }
            }
            else
            {
                if (!srcSet.contains(targetValue))
                {
                    Delta addDelta = new Delta(delta.id, delta.fieldName, srcPtr, null, targetValue, null);
                    addDelta.setCmd(SET_ADD);
                    deltas.add(addDelta);
                }
            }
        }

        // TODO: If LinkedHashSet, may need to issue commands to reorder...
    }
180487
function (alternativeBackingValue, compare) {
    var value = this.get();
    var alternativeValue = alternativeBackingValue ? alternativeBackingValue.getIn(this._path) : undefined;
    return compare ?
        !compare(value, alternativeValue) :
        !(value === alternativeValue || (Util.undefinedOrNull(value) && Util.undefinedOrNull(alternativeValue)));
  }
78609
def _check_values(self, values):
        """"""
        assert isinstance(values, Iterable) and not \
            isinstance(values, (str, dict, bytes, bytearray)), \
            'values should be a list or tuple. Got {}'.format(type(values))
        assert len(values) == len(self.datetimes), \
            'Length of values list must match length of datetimes list. {} != {}'.format(
                len(values), len(self.datetimes))
        assert len(values) > 0, 'Data Collection must include at least one value'
989940
public boolean isValueSet(String s) {
        return (s != null && s.trim().isEmpty() == false) ? true : false;
    }
1089858
private boolean matchesField(Format.Field attribute, int field) {
        if (this.attribute != null) {
            return this.attribute.equals(attribute);
        }
        return (field == this.field);
    }