Save validation data.

@param data the data
@return the validation data
760427
public ValidationData save(ValidationData data) {
        if (data.getParamType() == null || data.getUrl() == null || data.getMethod() == null || data.getType() == null || data.getTypeClass() == null) {
            throw new ValidationLibException("mandatory field is null ", HttpStatus.BAD_REQUEST);
        }

        ValidationData existData = this.findById(data.getId());

        if (existData == null) {
            return this.addData(data);
        } else {
            existData.setValidationRules(data.getValidationRules());
            return existData;
        }
    }
841577
private void lock_data() {
    source.read_lock(self());
    if( validation != null && source._key != null && validation._key !=null && !source._key.equals(validation._key) )
      validation.read_lock(self());
  }
533820
protected void buildData(String[] data, boolean validateOnly) {

        if (data == null) {
            return;
        }

        int length = data.length;

        for (int i = 0; i < length; i++) {
            addAddressToList(data[i], validateOnly);
        }

    }
15483
@Override
    public String save(Object pData) {
        String id =GUID.newGUID();
        if(pData instanceof TemplateModel)
        {
            TemplateModel entity =(TemplateModel)pData;
            entity.setId(id);
            entity.setRev(System.currentTimeMillis());
        }
        else if(pData instanceof CommonModel)
        {
            CommonModel entity =(CommonModel)pData;
            entity.setId(id);
        }
        mDao.insert(pData);
        return id;
    }
835271
private static Record createRecord(String data) {
        return new Record().withData(ByteBuffer.wrap(data.getBytes()));
    }
224710
public void put(int[] data) {
    final int l = data.length;
    for(int i = 0; i < l; i++) {
      put(data[i]);
    }
  }
646412
public static RawData sp2nbsp(Object data) {
        return new RawData(StringEscapeUtils.escapeHtml4(str(data)).replace(" ", "&nbsp;"));
    }
700362
public function validate($data = null)
    {
        if ($data !== null) {
            $this->setData($data);
        }
        // data was already validated, return the results immediately
        if ($this->wasValidated === true) {
            return $this->wasValidated && count($this->messages) === 0;
        }
        foreach ($this->rules as $selector => $valueValidator) {
            foreach ($this->getDataWrapper()->getItemsBySelector($selector) as $valueIdentifier => $value) {
                /* @var $valueValidator \Sirius\Validation\ValueValidator */
                if (!$valueValidator->validate($value, $valueIdentifier, $this->getDataWrapper())) {
                    foreach ($valueValidator->getMessages() as $message) {
                        $this->addMessage($valueIdentifier, $message);
                    }
                }
            }
        }
        $this->wasValidated = true;

        return $this->wasValidated && count($this->messages) === 0;
    }
1218378
public static Data toHeapData(Data data) {
        if (data == null || data instanceof HeapData) {
            return data;
        }
        return new HeapData(data.toByteArray());
    }
442729
public function save($data)
    {
        $tags = array();
        foreach ($this->_tags as $tag) {
            $tags[] = $tag->getNativeId();
        }
        $raw = serialize($data);
        $this->_getBackend()->save($raw, $this->_id, $tags, $this->_lifetime);
    }
440952
def validate(self, data):
        
        for s in [self._schema(s, error=self._error, ignore_extra_keys=self._ignore_extra_keys) for s in self._args]:
            data = s.validate(data)
        return data
287145
def _save(self, data):
        
        self.state = data.get('state')
        self.created = dt_time(data.get('created'))
        self.updated = dt_time(data.get('updated'))
1167904
private static String validString(Object data) throws IOException {
        // Null is ok
        if (data == null) {
            return "";
        }
        if (!(data instanceof String)) {
            throw new IOException("Invalid non-String value found!");
        }
        return (String) data;
    }
33450
public FgExampleList getData(LogLinearXYData data) {
        IntObjectBimap<String> alphabet = data.getFeatAlphabet();
        List<LogLinearExample> exList = data.getData();    
        if (this.alphabet == null) {
            this.alphabet = alphabet;
            this.stateNames = getStateNames(exList, data.getYAlphabet());
        }
        
        if (prm.cacheExamples) {
            FgExampleMemoryStore store = new FgExampleMemoryStore();
            for (final LogLinearExample desc : exList) {
                LFgExample ex = getFgExample(desc);
                store.add(ex);
            }
            return store;
        } else {
            return new FgExampleList() {
                @Override
                public LFgExample get(int i) {
                    return getFgExample(exList.get(i));
                }
                @Override
                public int size() {
                    return exList.size();
                }                
            };
        }
    }
1258581
public function save($data = null)
    {

        //1. Check if we have data and deal with it!
        if (!is_null($data)) {
            if (!$this->bindData($data)) {
                //we could not save the data
                return false;
            }
        }
        //2. Check if the primary key has a value
        $primary = $this->keys();

        //3. if the primary key has a value, then we are updating, else we are inserting
        if (isset($primary->Value) && !empty($primary->Value)) {
            return $this->update($primary->Value);
        } else {
            return $this->insert();
        }
        //if we get here then there is a problem
        return false;
    }
627973
private static Data checkData(final Data data) {
		if (Data.EMPTY.equals(data)) {
			throw new IllegalStateException("Argument 'data' must not be empty.");
		}
		return data;
	}
547546
def validate(self, data):
        '''
        '''
        try:
            self._validator.validate(data)
        except jsonschema.ValidationError as e:
            six.raise_from(ValidationError.create_from(e), e)