package com.github.plushaze.traynotification.notification;

import java.util.Objects;

import com.github.plushaze.traynotification.animations.Animation;
import com.github.plushaze.traynotification.animations.Animations;

import javafx.stage.Stage;

public class TrayNotificationBuilder
{
	private String			title	= "";
	private String			message	= "";
	private String			stylesheetLocation;
	private Notification	type	= Notifications.INFORMATION;
	private Stage			owner	= null;

	private Animations	animations	= Animations.NONE;
	private Animation	animation	= null;

	/**
	 * Sets the title.
	 *
	 * @param titleToSet
	 *            title to be set (default is an empty string)
	 * @return own {@link TrayNotificationBuilder} instance
	 */
	public TrayNotificationBuilder title(final String titleToSet)
	{
		title = elseGet(titleToSet, "");
		return this;
	}

	/**
	 * Sets the message.
	 *
	 * @param messageToSet
	 *            message to be set (default is an empty string)
	 * @return own {@link TrayNotificationBuilder} instance
	 */
	public TrayNotificationBuilder message(final String messageToSet)
	{
		message = elseGet(messageToSet, "");
		return this;
	}

	/**
	 * Sets the Stage that owns this TrayNotification, this will cause the TrayNotification to apply
	 * the owner stages icons.
	 *
	 * @param ownerToSet
	 *            stage that owns this TrayNotification (default is null)
	 * @return own {@link TrayNotificationBuilder} instance
	 */
	public TrayNotificationBuilder owner(final Stage ownerToSet)
	{
		this.owner = ownerToSet;
		return this;
	}

	/**
	 * Sets the Notification (type).
	 *
	 * @param typeToSet
	 *            type to be set (default is {@link Notifications#INFORMATION})
	 * @return own {@link TrayNotificationBuilder} instance
	 */
	public TrayNotificationBuilder type(final Notification typeToSet)
	{
		type = elseGet(typeToSet, Notifications.INFORMATION);
		return this;
	}

	/**
	 * Sets the stylesheet location.
	 *
	 * @param stylesheetLocationToSet
	 *            stylesheet location to be set
	 * @return own {@link TrayNotificationBuilder} instance
	 */
	public TrayNotificationBuilder stylesheet(final String stylesheetLocationToSet)
	{
		stylesheetLocation = stylesheetLocationToSet;
		return this;
	}

	/**
	 * Sets the Animation for the {@link TrayNotification} object that will be created.
	 *
	 * @param animationsToSet
	 *            the {@link Animations ANimation} that is to set
	 * @return own {@link TrayNotificationBuilder} instance
	 */
	public TrayNotificationBuilder animation(final Animations animationsToSet)
	{
		animations = elseGet(animationsToSet, Animations.NONE);
		return this;
	}

	/**
	 * Sets the Animation for the {@link TrayNotification} object that will be created.
	 *
	 * @param animationsToSet
	 *            the {@link Animation ANimation} that is to set
	 * @return own {@link TrayNotificationBuilder} instance
	 */
	public TrayNotificationBuilder animation(final Animation animationToSet)
	{
		animation = animationToSet;
		return this;
	}

	public TrayNotification build()
	{
		final TrayNotification newTrayNotification = new TrayNotification(owner, title, message, type, stylesheetLocation);
		if (Objects.nonNull(animation))
		{
			newTrayNotification.setAnimation(animation);
		}
		else if (Objects.nonNull(animations))
		{
			newTrayNotification.setAnimation(animations);
		}
		return newTrayNotification;
	}

	private static <T> T elseGet(final T obj, final T altObj)
	{
		return Objects.isNull(obj) ? altObj : obj;
	}
}

@@ -281,16 +281,59 @@
 ilder%0A%7B%0A
+%09private static String defaultStylesheet;%0A%0A
 %09private
@@ -600,16 +600,301 @@
  null;%0A%0A
+%09/**%0A%09 * Sets the default stylesheet location that will be used if no other has been specified.%0A%09 *%0A%09 * @param stylesheet%0A%09 *            the path for the default stylesheet%0A%09 */%0A%09public static void setDefaultStylesheet(final String stylesheet)%0A%09%7B%0A%09%09defaultStylesheet = stylesheet;%0A%09%7D%0A%0A
 %09/**%0A%09 *
@@ -3343,16 +3343,81 @@
 is;%0A%09%7D%0A%0A
+%09/**%0A%09 * @return Returns the built %7B@link TrayNotification%7D%0A%09 */%0A
 %09public 
@@ -3541,16 +3541,24 @@
 , type, 
+elseGet(
 styleshe
@@ -3563,24 +3563,44 @@
 heetLocation
+, defaultStylesheet)
 );%0A%09%09if (Obj

Add default additional stylesheet for tray notification