package androidx.appsearch.debugview.view; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.navigation.NavArgs; import java.lang.IllegalArgumentException; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.lang.SuppressWarnings; import java.util.HashMap; public class DocumentFragmentArgs implements NavArgs { private final HashMap arguments = new HashMap(); private DocumentFragmentArgs() { } @SuppressWarnings("unchecked") private DocumentFragmentArgs(HashMap argumentsMap) { this.arguments.putAll(argumentsMap); } @NonNull @SuppressWarnings("unchecked") public static DocumentFragmentArgs fromBundle(@NonNull Bundle bundle) { DocumentFragmentArgs __result = new DocumentFragmentArgs(); bundle.setClassLoader(DocumentFragmentArgs.class.getClassLoader()); if (bundle.containsKey("document_uri")) { String documentUri; documentUri = bundle.getString("document_uri"); if (documentUri == null) { throw new IllegalArgumentException("Argument \"document_uri\" is marked as non-null but was passed a null value."); } __result.arguments.put("document_uri", documentUri); } else { throw new IllegalArgumentException("Required argument \"document_uri\" is missing and does not have an android:defaultValue"); } if (bundle.containsKey("document_namespace")) { String documentNamespace; documentNamespace = bundle.getString("document_namespace"); if (documentNamespace == null) { throw new IllegalArgumentException("Argument \"document_namespace\" is marked as non-null but was passed a null value."); } __result.arguments.put("document_namespace", documentNamespace); } else { throw new IllegalArgumentException("Required argument \"document_namespace\" is missing and does not have an android:defaultValue"); } return __result; } @SuppressWarnings("unchecked") @NonNull public String getDocumentUri() { return (String) arguments.get("document_uri"); } @SuppressWarnings("unchecked") @NonNull public String getDocumentNamespace() { return (String) arguments.get("document_namespace"); } @SuppressWarnings("unchecked") @NonNull public Bundle toBundle() { Bundle __result = new Bundle(); if (arguments.containsKey("document_uri")) { String documentUri = (String) arguments.get("document_uri"); __result.putString("document_uri", documentUri); } if (arguments.containsKey("document_namespace")) { String documentNamespace = (String) arguments.get("document_namespace"); __result.putString("document_namespace", documentNamespace); } return __result; } @Override public boolean equals(Object object) { if (this == object) { return true; } if (object == null || getClass() != object.getClass()) { return false; } DocumentFragmentArgs that = (DocumentFragmentArgs) object; if (arguments.containsKey("document_uri") != that.arguments.containsKey("document_uri")) { return false; } if (getDocumentUri() != null ? !getDocumentUri().equals(that.getDocumentUri()) : that.getDocumentUri() != null) { return false; } if (arguments.containsKey("document_namespace") != that.arguments.containsKey("document_namespace")) { return false; } if (getDocumentNamespace() != null ? !getDocumentNamespace().equals(that.getDocumentNamespace()) : that.getDocumentNamespace() != null) { return false; } return true; } @Override public int hashCode() { int result = 1; result = 31 * result + (getDocumentUri() != null ? getDocumentUri().hashCode() : 0); result = 31 * result + (getDocumentNamespace() != null ? getDocumentNamespace().hashCode() : 0); return result; } @Override public String toString() { return "DocumentFragmentArgs{" + "documentUri=" + getDocumentUri() + ", documentNamespace=" + getDocumentNamespace() + "}"; } public static class Builder { private final HashMap arguments = new HashMap(); @SuppressWarnings("unchecked") public Builder(DocumentFragmentArgs original) { this.arguments.putAll(original.arguments); } @SuppressWarnings("unchecked") public Builder(@NonNull String documentUri, @NonNull String documentNamespace) { if (documentUri == null) { throw new IllegalArgumentException("Argument \"document_uri\" is marked as non-null but was passed a null value."); } this.arguments.put("document_uri", documentUri); if (documentNamespace == null) { throw new IllegalArgumentException("Argument \"document_namespace\" is marked as non-null but was passed a null value."); } this.arguments.put("document_namespace", documentNamespace); } @NonNull public DocumentFragmentArgs build() { DocumentFragmentArgs result = new DocumentFragmentArgs(arguments); return result; } @NonNull @SuppressWarnings("unchecked") public Builder setDocumentUri(@NonNull String documentUri) { if (documentUri == null) { throw new IllegalArgumentException("Argument \"document_uri\" is marked as non-null but was passed a null value."); } this.arguments.put("document_uri", documentUri); return this; } @NonNull @SuppressWarnings("unchecked") public Builder setDocumentNamespace(@NonNull String documentNamespace) { if (documentNamespace == null) { throw new IllegalArgumentException("Argument \"document_namespace\" is marked as non-null but was passed a null value."); } this.arguments.put("document_namespace", documentNamespace); return this; } @SuppressWarnings("unchecked") @NonNull public String getDocumentUri() { return (String) arguments.get("document_uri"); } @SuppressWarnings("unchecked") @NonNull public String getDocumentNamespace() { return (String) arguments.get("document_namespace"); } } }