/** * Set event data and java type of event data. * * This is a convenience method that derives the event data type information from the runtime type of * the event data. The supplied event data may be represented as {@link javax.ws.rs.core.GenericEntity}. * <p> * Note that multiple invocations of this method result in previous even data being replaced with new one. * </p> * * @param data event data. Must not be {@code null}. * @return updated builder instance. * @throws NullPointerException in case the {@code data} parameter is {@code null}. * @since 2.3 */ public Builder data(Object data) { if (data == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_NULL()); } return data(ReflectionHelper.genericTypeFor(data), data); }
/** * Set event data and java type of event data. * * Type information will be used for {@link javax.ws.rs.ext.MessageBodyWriter} lookup. * <p> * Note that multiple invocations of this method result in previous even data being replaced with new one. * </p> * * @param type java type of supplied data. Must not be {@code null}. * @param data event data. Must not be {@code null}. * @return updated builder instance. * @throws NullPointerException in case either {@code type} or {@code data} parameter is {@code null}. */ public Builder data(Class type, Object data) { if (data == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_NULL()); } if (type == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_TYPE_NULL()); } this.type = new GenericType(type); this.data = data; return this; }
/** * Set event data and a generic java type of event data. * * Type information will be used for {@link javax.ws.rs.ext.MessageBodyWriter} lookup. * <p> * Note that multiple invocations of this method result in previous even data being replaced with new one. * </p> * * @param type generic type of supplied data. Must not be {@code null}. * @param data event data. Must not be {@code null}. * @return updated builder instance. * @throws NullPointerException in case either {@code type} or {@code data} parameter is {@code null}. * @since 2.3 */ public Builder data(GenericType type, Object data) { if (data == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_NULL()); } if (type == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_TYPE_NULL()); } this.type = type; if (data instanceof GenericEntity) { this.data = ((GenericEntity) data).getEntity(); } else { this.data = data; } return this; }
/** * Set event data and a generic java type of event data. * * Type information will be used for {@link javax.ws.rs.ext.MessageBodyWriter} lookup. * <p> * Note that multiple invocations of this method result in previous even data being replaced with new one. * </p> * * @param type generic type of supplied data. Must not be {@code null}. * @param data event data. Must not be {@code null}. * @return updated builder instance. * @throws NullPointerException in case either {@code type} or {@code data} parameter is {@code null}. * @since 2.3 */ public Builder data(GenericType type, Object data) { if (data == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_NULL()); } if (type == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_TYPE_NULL()); } this.type = type; this.data = data; return this; }
/** * Set event data and a generic java type of event data. * * Type information will be used for {@link javax.ws.rs.ext.MessageBodyWriter} lookup. * <p> * Note that multiple invocations of this method result in previous even data being replaced with new one. * </p> * * @param type generic type of supplied data. Must not be {@code null}. * @param data event data. Must not be {@code null}. * @return updated builder instance. * @throws NullPointerException in case either {@code type} or {@code data} parameter is {@code null}. * @since 2.3 */ public Builder data(GenericType type, Object data) { if (data == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_NULL()); } if (type == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_TYPE_NULL()); } this.type = type; this.data = data; return this; }
/** * Set event data and a generic java type of event data. * * Type information will be used for {@link javax.ws.rs.ext.MessageBodyWriter} lookup. * <p> * Note that multiple invocations of this method result in previous even data being replaced with new one. * </p> * * @param type generic type of supplied data. Must not be {@code null}. * @param data event data. Must not be {@code null}. * @return updated builder instance. * @throws NullPointerException in case either {@code type} or {@code data} parameter is {@code null}. * @since 2.3 */ public Builder data(GenericType type, Object data) { if (data == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_NULL()); } if (type == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_TYPE_NULL()); } this.type = type; this.data = data; return this; }
/** * Set event data and java type of event data. * * This is a convenience method that derives the event data type information from the runtime type of * the event data. The supplied event data may be represented as {@link javax.ws.rs.core.GenericEntity}. * <p> * Note that multiple invocations of this method result in previous even data being replaced with new one. * </p> * * @param data event data. Must not be {@code null}. * @return updated builder instance. * @throws NullPointerException in case the {@code data} parameter is {@code null}. * @since 2.3 */ public Builder data(Object data) { if (data == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_NULL()); } return data(ReflectionHelper.genericTypeFor(data), data); }
/** * Set event data and java type of event data. * * This is a convenience method that derives the event data type information from the runtime type of * the event data. The supplied event data may be represented as {@link javax.ws.rs.core.GenericEntity}. * <p> * Note that multiple invocations of this method result in previous even data being replaced with new one. * </p> * * @param data event data. Must not be {@code null}. * @return updated builder instance. * @throws NullPointerException in case the {@code data} parameter is {@code null}. * @since 2.3 */ public Builder data(Object data) { if (data == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_NULL()); } return data(ReflectionHelper.genericTypeFor(data), data); }
/** * Set event data and java type of event data. * * Type information will be used for {@link javax.ws.rs.ext.MessageBodyWriter} lookup. * <p> * Note that multiple invocations of this method result in previous even data being replaced with new one. * </p> * * @param type java type of supplied data. Must not be {@code null}. * @param data event data. Must not be {@code null}. * @return updated builder instance. * @throws NullPointerException in case either {@code type} or {@code data} parameter is {@code null}. */ public Builder data(Class type, Object data) { if (data == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_NULL()); } if (type == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_TYPE_NULL()); } this.type = new GenericType(type); this.data = data; return this; }
/** * Set event data and java type of event data. * * This is a convenience method that derives the event data type information from the runtime type of * the event data. The supplied event data may be represented as {@link javax.ws.rs.core.GenericEntity}. * <p> * Note that multiple invocations of this method result in previous even data being replaced with new one. * </p> * * @param data event data. Must not be {@code null}. * @return updated builder instance. * @throws NullPointerException in case the {@code data} parameter is {@code null}. * @since 2.3 */ public Builder data(Object data) { if (data == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_NULL()); } return data(ReflectionHelper.genericTypeFor(data), data); }
/** * Set event data and java type of event data. * * Type information will be used for {@link javax.ws.rs.ext.MessageBodyWriter} lookup. * <p> * Note that multiple invocations of this method result in previous even data being replaced with new one. * </p> * * @param type java type of supplied data. Must not be {@code null}. * @param data event data. Must not be {@code null}. * @return updated builder instance. * @throws NullPointerException in case either {@code type} or {@code data} parameter is {@code null}. */ public Builder data(Class type, Object data) { if (data == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_NULL()); } if (type == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_TYPE_NULL()); } this.type = new GenericType(type); this.data = data; return this; }
/** * Set event data and java type of event data. * * Type information will be used for {@link javax.ws.rs.ext.MessageBodyWriter} lookup. * <p> * Note that multiple invocations of this method result in previous even data being replaced with new one. * </p> * * @param type java type of supplied data. Must not be {@code null}. * @param data event data. Must not be {@code null}. * @return updated builder instance. * @throws NullPointerException in case either {@code type} or {@code data} parameter is {@code null}. */ public Builder data(Class type, Object data) { if (data == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_NULL()); } if (type == null) { throw new NullPointerException(LocalizationMessages.OUT_EVENT_DATA_TYPE_NULL()); } this.type = new GenericType(type); this.data = data; return this; }