com.getsentry.raven.event.BreadcrumbBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of raven Show documentation
Show all versions of raven Show documentation
Sentry client written in Java.
package com.getsentry.raven.event;
import java.util.Date;
import java.util.Map;
/**
* Builder to assist the creation of {@link Breadcrumb}s.
*/
public class BreadcrumbBuilder {
private String type;
private Date timestamp;
private String level;
private String message;
private String category;
private Map data;
/**
* Type of the {@link Breadcrumb}.
*
* @param newType String
* @return current BreadcrumbBuilder
*/
public BreadcrumbBuilder setType(String newType) {
this.type = newType;
return this;
}
/**
* Timestamp of the {@link Breadcrumb}.
*
* @param newTimestamp Date
* @return current BreadcrumbBuilder
*/
public BreadcrumbBuilder setTimestamp(Date newTimestamp) {
this.timestamp = newTimestamp;
return this;
}
/**
* Level of the {@link Breadcrumb}.
*
* @param newLevel String
* @return current BreadcrumbBuilder
*/
public BreadcrumbBuilder setLevel(String newLevel) {
this.level = newLevel;
return this;
}
/**
* Message of the {@link Breadcrumb}. At least one of message or
* data is required.
*
* @param newMessage String
* @return current BreadcrumbBuilder
*/
public BreadcrumbBuilder setMessage(String newMessage) {
this.message = newMessage;
return this;
}
/**
* Category of the {@link Breadcrumb}.
*
* @param newCategory String
* @return current BreadcrumbBuilder
*/
public BreadcrumbBuilder setCategory(String newCategory) {
this.category = newCategory;
return this;
}
/**
* Data related to the {@link Breadcrumb}. At least one of message or
* data is required.
*
* @param newData Map of String to String
* @return current BreadcrumbBuilder
*/
public BreadcrumbBuilder setData(Map newData) {
this.data = newData;
return this;
}
/**
* Build and return the {@link Breadcrumb} object.
*
* @return Breadcrumb
*/
public Breadcrumb build() {
return new Breadcrumb(type, timestamp, level, message, category, data);
}
}