<commit_before>package com.celements.docform;

import org.apache.commons.lang.ObjectUtils;
import org.xwiki.model.reference.DocumentReference;

public class DocFormRequestKey {

  private final String keyString;
  private final DocumentReference docRef;
  private final DocumentReference classRef;
  private final boolean remove;
  private final Integer objNb;
  private final String fieldName;
  
  public DocFormRequestKey(String key, DocumentReference docRef, 
      DocumentReference classRef, boolean remove, Integer objNb, String fieldName) {
    this.keyString = key;
    this.docRef = docRef;
    this.classRef = classRef;
    this.remove = remove;
    this.objNb = objNb;
    this.fieldName = fieldName;
  }

  public String getKeyString() {
    return keyString;
  }

  public DocumentReference getDocRef() {
    return docRef;
  }

  public DocumentReference getClassRef() {
    return classRef;
  }

  public boolean isRemove() {
    return remove;
  }

  public Integer getObjNb() {
    return objNb;
  }

  public String getFieldName() {
    return fieldName;
  }

  public boolean sameObject(DocFormRequestKey other) {
    return (this.classRef != null) && (this.objNb != null) && (this.objNb >= 0)
        && ObjectUtils.equals(this.classRef, other.classRef) 
        && ObjectUtils.equals(this.objNb, other.objNb);
  }

  @Override
  public String toString() {
    return "DocFormRequestKey [keyString=" + keyString + ", docRef=" + docRef 
        + ", classRef=" + classRef + ", remove=" + remove + ", objNb=" + objNb 
        + ", fieldName=" + fieldName + "]";
  }

}<commit_msg>DocFormRequestKey.isWhiteListed() added<commit_after>package com.celements.docform;

import org.apache.commons.lang.ObjectUtils;
import org.xwiki.model.reference.DocumentReference;

public class DocFormRequestKey {

  private final String keyString;
  private final DocumentReference docRef;
  private final DocumentReference classRef;
  private final boolean remove;
  private final Integer objNb;
  private final String fieldName;
  
  public DocFormRequestKey(String key, DocumentReference docRef, 
      DocumentReference classRef, boolean remove, Integer objNb, String fieldName) {
    this.keyString = key;
    this.docRef = docRef;
    this.classRef = classRef;
    this.remove = remove;
    this.objNb = objNb;
    this.fieldName = fieldName;
  }

  public String getKeyString() {
    return keyString;
  }

  public DocumentReference getDocRef() {
    return docRef;
  }

  public DocumentReference getClassRef() {
    return classRef;
  }

  public boolean isRemove() {
    return remove;
  }

  public Integer getObjNb() {
    return objNb;
  }

  public String getFieldName() {
    return fieldName;
  }

  public boolean isWhiteListed() {
    return (getClassRef() == null) && (getObjNb() == null) && getFieldName().matches(
        DocFormRequestKeyParser.REGEX_WHITELIST);
  }

  public boolean sameObject(DocFormRequestKey other) {
    return (this.classRef != null) && (this.objNb != null) && (this.objNb >= 0)
        && ObjectUtils.equals(this.classRef, other.classRef) 
        && ObjectUtils.equals(this.objNb, other.objNb);
  }

  @Override
  public String toString() {
    return "DocFormRequestKey [keyString=" + keyString + ", docRef=" + docRef 
        + ", classRef=" + classRef + ", remove=" + remove + ", objNb=" + objNb 
        + ", fieldName=" + fieldName + "]";
  }

}
{'fraction_non_alphanumeric': 0.10647058823529412, 'fraction_numerical': 0.000588235294117647, 'mean_word_length': 3.498677248677249, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2140087', 'n_tokens_mistral': 1058, 'n_tokens_neox': 1028, 'n_words': 253}