Tabnine Logo
FixedRekord
Code IndexAdd Tabnine to your IDE (free)

How to use
FixedRekord
in
com.noodlesandwich.rekord

Best Java code snippets using com.noodlesandwich.rekord.FixedRekord (Showing top 20 results out of 315)

origin: SamirTalwar/Rekord

@Override
public Keys<T> acceptedKeys() {
  return delegate.acceptedKeys();
}
origin: SamirTalwar/Rekord

@Override
public <V> V get(Key<T, V> key) {
  return delegate.get(key);
}
origin: SamirTalwar/Rekord

@Override
public boolean has(Key<T, ?> key) {
  return delegate.has(key);
}
origin: SamirTalwar/Rekord

public static <T> boolean equals(FixedRekord<T> a, Object bObject) {
  if (a == bObject) {
    return true;
  }
  if (!(bObject instanceof FixedRekord)) {
    return false;
  }
  @SuppressWarnings("unchecked")
  FixedRekord<T> b = (FixedRekord<T>) bObject;
  return a.name().equals(b.name()) && a.properties().equals(b.properties());
}
origin: SamirTalwar/Rekord

  @Override
  protected boolean matchesSafely(FixedRekord<T> rekord, Description mismatchDescription) {
    Keys<T> expectedKeys = rekord.acceptedKeys();
    Keys<T> actualKeys = rekord.keys();
    Set<Key<T, ?>> missingKeys = difference(expectedKeys, actualKeys);
    mismatchDescription.appendText("was missing the keys ").appendValue(missingKeys);
    return missingKeys.isEmpty();
  }
};
origin: SamirTalwar/Rekord

  @Override
  protected boolean matchesSafely(FixedRekord<T> actualRekord, Description mismatchDescription) {
    mismatchDescription.appendText("a rekord that looks like ").appendValue(actualRekord);

    if (!expectedProperties.keySet().equals(actualRekord.keys().toSet())) {
      return false;
    }

    for (Map.Entry<Key<T, ?>, Matcher<?>> property : expectedProperties.entrySet()) {
      Key<T, ?> expectedKey = property.getKey();
      Matcher<?> expectedValue = property.getValue();
      if (!expectedValue.matches(actualRekord.get(expectedKey))) {
        return false;
      }
    }
    return true;
  }
}
origin: SamirTalwar/Rekord

@Override
public Properties<T> properties() {
  return delegate.properties();
}
origin: SamirTalwar/Rekord

@Override
public String name() {
  return delegate.name();
}
origin: SamirTalwar/Rekord

@Override
public Keys<T> keys() {
  return delegate.keys();
}
origin: SamirTalwar/Rekord

  @Override
  public String toString() {
    return delegate.toString();
  }
}
origin: SamirTalwar/Rekord

@Override
public <R, E extends Exception> R serialize(Serializer<R, E> serializer) throws E {
  return delegate.serialize(serializer);
}
origin: SamirTalwar/Rekord

  public static <T> int hashCode(FixedRekord<T> rekord) {
    return Objects.hash(rekord.name(), rekord.properties());
  }
}
origin: SamirTalwar/Rekord

@Override
public Properties<T> properties() {
  return delegate.properties();
}
origin: SamirTalwar/Rekord

@Override
public String name() {
  return delegate.name();
}
origin: SamirTalwar/Rekord

@Override
public Keys<T> keys() {
  return delegate.keys();
}
origin: SamirTalwar/Rekord

  @Override
  public String toString() {
    return delegate.toString();
  }
}
origin: SamirTalwar/Rekord

@Override
public <R, E extends Exception> R serialize(Serializer<R, E> serializer) throws E {
  return delegate.serialize(serializer);
}
origin: SamirTalwar/Rekord

@Override
public ValidatingRekord<T> merge(FixedRekord<T> other) {
  ValidatingRekord<T> result = this;
  for (Property<T, ?> property : other.properties()) {
    result = result.with(property);
  }
  return result;
}
origin: SamirTalwar/Rekord

@Override
public <T> Document serialize(String name, FixedRekord<T> rekord) throws ParserConfigurationException {
  DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
  Document document = documentBuilder.newDocument();
  NodeCreator nodeCreator = new NodeCreator(locale, document);
  Element root = nodeCreator.elementNamed(rekord.name());
  Serialization.serialize(rekord).into(new DomXmlAccumulator(root, nodeCreator));
  document.appendChild(root);
  return document;
}
origin: SamirTalwar/Rekord

  @Override
  protected boolean matchesSafely(FixedRekord<T> rekord, Description mismatchDescription) {
    Keys<T> actualKeys = rekord.keys();
    Set<Key<T, ?>> missingKeys = difference(expectedKeys, actualKeys);
    mismatchDescription.appendText("was missing the keys ").appendValue(missingKeys);
    return missingKeys.isEmpty();
  }
};
com.noodlesandwich.rekordFixedRekord

Most used methods

  • acceptedKeys
  • get
  • has
  • keys
  • name
  • properties
  • serialize
  • toString

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (Timer)
  • setContentView (Activity)
  • getContentResolver (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now