/**
 * The MIT License
 *
 * Copyright (C) 2015 Asterios Raptis
 *
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:
 *
 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
package de.alpharogroup.lang.thread;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * The class {@link ThreadDataBean} holds data from a Thread.
 */
@Getter
@Setter
@EqualsAndHashCode
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder(toBuilder = true)
public class ThreadDataBean {
	private Integer priority;
	private boolean alive;
	private boolean daemon;
	private boolean interrupted;
	private String threadGroup;
	private String name;

	public static ThreadDataBean of(final Thread thread) {
		return ThreadDataBean.builder()
				.priority(thread.getPriority())
				.alive(thread.isAlive())
				.daemon(thread.isDaemon())
				.interrupted(thread.isInterrupted())
				.threadGroup(thread.getThreadGroup().getName())
				.name(thread.getName())
				.build();
	}
}

@@ -1581,168 +1581,10 @@
 Bean
- %7B%0A%09private Integer priority;%0A%09private boolean alive;%0A%09private boolean daemon;%0A%09private boolean interrupted;%0A%09private String threadGroup;%0A%09private String name;
 %0A
+%7B
 %0A%09pu
@@ -1633,17 +1633,18 @@
  thread)
- 
+%0A%09
 %7B%0A%09%09retu
@@ -1670,21 +1670,16 @@
 uilder()
-%0A%09%09%09%09
 .priorit
@@ -1701,21 +1701,16 @@
 ority())
-%0A%09%09%09%09
 .alive(t
@@ -1722,25 +1722,24 @@
 .isAlive())%0A
-%09
 %09%09%09.daemon(t
@@ -1755,21 +1755,16 @@
 aemon())
-%0A%09%09%09%09
 .interru
@@ -1788,25 +1788,24 @@
 errupted())%0A
-%09
 %09%09%09.threadGr
@@ -1842,21 +1842,16 @@
 tName())
-%0A%09%09%09%09
 .name(th
@@ -1869,13 +1869,8 @@
 e())
-%0A%09%09%09%09
 .bui
@@ -1878,10 +1878,168 @@
 d();%0A%09%7D%0A
+%09private Integer priority;%0A%09private boolean alive;%0A%09private boolean daemon;%0A%09private boolean interrupted;%0A%09private String threadGroup;%0A%0A%09private String name;%0A
 %7D%0A

comment format