Codota Logo
com.workday.postman
Code IndexAdd Codota to your IDE (free)

How to use com.workday.postman

Best Java code snippets using com.workday.postman (Showing top 16 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: Workday/postman

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    Postman.writeToParcel(this, dest);
  }
}
origin: com.workday/postman

/**
 * Reads an object of the specified class from the given Parcel.
 *
 * @param clazz The class of the object to be read.
 * @param parcel The source Parcel.
 * @param <T> The type of the Object.
 *
 * @return A new instance of the specified type instantiated from the Parcel.
 *
 * @throws PostmanException if there is no {@link Parceler} associated with the given type.
 */
public static <T> T readFromParcel(Class<T> clazz, Parcel parcel) throws PostmanException {
  Parceler<T> parceler = getParcelerForClass(clazz);
  return parceler.readFromParcel(parcel);
}
origin: com.workday/postman

/**
 * Creates of new array of the specified type with the specified size.
 *
 * @param clazz The class associated with the type of array to create.
 * @param size The desired size of the array.
 * @param <T> The type of the array to create.
 *
 * @return A new array of the specified type with the specified size.
 *
 * @throws PostmanException if there is no {@link Parceler} associated with the given type.
 * @see Creator#newArray(int)
 */
public static <T> T[] newArray(Class<T> clazz, int size) throws PostmanException {
  Parceler<T> parceler = getParcelerForClass(clazz);
  return parceler.newArray(size);
}
origin: com.workday/postman

/**
 * Write the specified Object to a {@link Parcel}.
 *
 * @param object The Object to be written to the Parcel.
 * @param parcel The destination Parcel.
 * @param <T> The type of the Object.
 *
 * @throws PostmanException if there is no {@link Parceler} associated with the given type.
 */
public static <T> void writeToParcel(T object, Parcel parcel) throws PostmanException {
  @SuppressWarnings("unchecked")
  Parceler<T> parceler = getParcelerForClass((Class<T>) object.getClass());
  parceler.writeToParcel(object, parcel);
}
origin: Workday/postman

@Test
public void testNonParceledClassThrowsPostmanException() {
  Object o = new Object();
  boolean exceptionCaught = false;
  try {
    Postman.writeToParcel(o, Parcel.obtain());
  } catch (PostmanException e) {
    exceptionCaught = true;
    assertTrue("expected cause to be of type ClassNotFoundException but found " +
              e.getCause().getClass().getCanonicalName(),
          e.getCause() instanceof ClassNotFoundException);
  }
  assertTrue(exceptionCaught);
}
origin: com.workday/postman

/**
 * Get a {@link Creator} that can be used for the {@code CREATOR} field of a {@link
 * Parcelable}.
 *
 * @param clazz The class associated with the type the the Creator will create.
 * @param <T> The type the Creator will create.
 *
 * @return A fully implemented Creator for the specified type.
 *
 * @throws PostmanException if there is no {@link Parceler} associated with the given type.
 */
public static <T> Parcelable.Creator<T> getCreator(Class<T> clazz) throws PostmanException {
  @SuppressWarnings("unchecked")
  Parcelable.Creator<T> creator = (Parcelable.Creator<T>) creatorMap.get(clazz);
  if (creator == null) {
    creator = newCreator(clazz);
    creatorMap.put(clazz, creator);
  }
  return creator;
}
origin: com.workday/postman

private static <T> Parceler<T> getParcelerForClass(Class<T> clazz) {
  @SuppressWarnings("unchecked")
  Parceler<T> parceler = (com.workday.postman.parceler.Parceler<T>) parcelerMap.get(clazz);
  if (parceler == null) {
    String name = ConcreteTypeNames.constructClassName(clazz, Names.PARCELER_SUFFIX);
    try {
      @SuppressWarnings("unchecked")
      Parceler<T> newParceler = (Parceler<T>) Class.forName(name).newInstance();
      parceler = newParceler;
    } catch (InstantiationException | IllegalAccessException e) {
      String message = "Postman experienced an internal error. Please report this issue.";
      throw new PostmanException(message, e);
    } catch (ClassNotFoundException e) {
      String message = String.format(
          "No %s was found for class %s. Check that (1) you annotated the class "
              + "with @%s, (2) the Postman processor ran, and (3) ProGuard did "
              + "not remove the Parcelers.",
          Parceler.class.getSimpleName(),
          clazz.getCanonicalName(),
          Parceled.class.getSimpleName());
      throw new PostmanException(message, e);
    }
    parcelerMap.put(clazz, parceler);
  }
  return parceler;
}
origin: Workday/postman

/**
 * Reads an object of the specified class from the given Parcel.
 *
 * @param clazz The class of the object to be read.
 * @param parcel The source Parcel.
 * @param <T> The type of the Object.
 *
 * @return A new instance of the specified type instantiated from the Parcel.
 *
 * @throws PostmanException if there is no {@link Parceler} associated with the given type.
 */
public static <T> T readFromParcel(Class<T> clazz, Parcel parcel) throws PostmanException {
  Parceler<T> parceler = getParcelerForClass(clazz);
  return parceler.readFromParcel(parcel);
}
origin: Workday/postman

/**
 * Creates of new array of the specified type with the specified size.
 *
 * @param clazz The class associated with the type of array to create.
 * @param size The desired size of the array.
 * @param <T> The type of the array to create.
 *
 * @return A new array of the specified type with the specified size.
 *
 * @throws PostmanException if there is no {@link Parceler} associated with the given type.
 * @see Creator#newArray(int)
 */
public static <T> T[] newArray(Class<T> clazz, int size) throws PostmanException {
  Parceler<T> parceler = getParcelerForClass(clazz);
  return parceler.newArray(size);
}
origin: Workday/postman

/**
 * Write the specified Object to a {@link Parcel}.
 *
 * @param object The Object to be written to the Parcel.
 * @param parcel The destination Parcel.
 * @param <T> The type of the Object.
 *
 * @throws PostmanException if there is no {@link Parceler} associated with the given type.
 */
public static <T> void writeToParcel(T object, Parcel parcel) throws PostmanException {
  @SuppressWarnings("unchecked")
  Parceler<T> parceler = getParcelerForClass((Class<T>) object.getClass());
  parceler.writeToParcel(object, parcel);
}
origin: Workday/postman

  @Override
  public void writeToParcel(Parcel dest, int flags) {
    Postman.writeToParcel(this, dest);
  }
}
origin: Workday/postman

/**
 * Get a {@link Creator} that can be used for the {@code CREATOR} field of a {@link
 * Parcelable}.
 *
 * @param clazz The class associated with the type the the Creator will create.
 * @param <T> The type the Creator will create.
 *
 * @return A fully implemented Creator for the specified type.
 *
 * @throws PostmanException if there is no {@link Parceler} associated with the given type.
 */
public static <T> Parcelable.Creator<T> getCreator(Class<T> clazz) throws PostmanException {
  @SuppressWarnings("unchecked")
  Parcelable.Creator<T> creator = (Parcelable.Creator<T>) creatorMap.get(clazz);
  if (creator == null) {
    creator = newCreator(clazz);
    creatorMap.put(clazz, creator);
  }
  return creator;
}
origin: Workday/postman

private static <T> Parceler<T> getParcelerForClass(Class<T> clazz) {
  @SuppressWarnings("unchecked")
  Parceler<T> parceler = (com.workday.postman.parceler.Parceler<T>) parcelerMap.get(clazz);
  if (parceler == null) {
    String name = ConcreteTypeNames.constructClassName(clazz, Names.PARCELER_SUFFIX);
    try {
      @SuppressWarnings("unchecked")
      Parceler<T> newParceler = (Parceler<T>) Class.forName(name).newInstance();
      parceler = newParceler;
    } catch (InstantiationException | IllegalAccessException e) {
      String message = "Postman experienced an internal error. Please report this issue.";
      throw new PostmanException(message, e);
    } catch (ClassNotFoundException e) {
      String message = String.format(
          "No %s was found for class %s. Check that (1) you annotated the class "
              + "with @%s, (2) the Postman processor ran, and (3) ProGuard did "
              + "not remove the Parcelers.",
          Parceler.class.getSimpleName(),
          clazz.getCanonicalName(),
          Parceled.class.getSimpleName());
      throw new PostmanException(message, e);
    }
    parcelerMap.put(clazz, parceler);
  }
  return parceler;
}
origin: Workday/postman

@Override
public void writeToParcel(Parcel dest, int flags) {
  Postman.writeToParcel(this, dest);
}
origin: Workday/postman

@Override
public void writeToParcel(Parcel dest, int flags) {
  Postman.writeToParcel(this, dest);
}
origin: Workday/postman

@Override
public void writeToParcel(Parcel dest, int flags) {
  Postman.writeToParcel(this, dest);
}
com.workday.postman

Most used classes

  • CollectionUtils
  • Postman
    Entry point for classes wishing to use the Postman framework to handle the implementation details of
  • PostmanException
  • ParcelableAdapters
  • AbstractCollectionParcelableAdapter$Creator
    The base implementation of android.os.Parcelable.Creator for Collection ParcelableAdapters. This bas
  • ArrayListParcelableAdapter,
  • BigDecimalParcelableAdapter,
  • BigIntegerParcelableAdapter,
  • BooleanParcelableAdapter,
  • ByteParcelableAdapter,
  • CharParcelableAdapter,
  • CharSequenceParcelableAdapter,
  • DoubleParcelableAdapter,
  • FloatParcelableAdapter,
  • HashMapParcelableAdapter,
  • HashSetParcelableAdapter,
  • IntParcelableAdapter,
  • LinkedHashMapParcelableAdapter,
  • LinkedHashSetParcelableAdapter
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now