Package com.sodius.oslc.server.model
Class Feedback
- java.lang.Object
-
- org.eclipse.lyo.oslc4j.core.model.AbstractResource
-
- com.sodius.oslc.server.model.Feedback
-
- All Implemented Interfaces:
IExtendedResource
,IResource
@OslcNamespace("http://www.sodius.com/ns/feedback#") @OslcResourceShape(title="Feedback Resource Shape", describes="http://www.sodius.com/ns/feedback#Feedback") public class Feedback extends AbstractResource
Defines a feedback, which is an ordered list of messages with an associated severity.- Since:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description Feedback()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Feedback
addError(String description)
Feedback
addError(String description, String detail)
Feedback
addInfo(String description)
Feedback
addInfo(String description, String detail)
void
addMessage(FeedbackMessage message)
Feedback
addSuccess(String description)
Feedback
addSuccess(String description, String detail)
Feedback
addWarning(String description)
Feedback
addWarning(String description, String detail)
static Feedback
error(String description)
Creates an instance with a single error message.static Feedback
error(String description, String detail)
Creates an instance with a single error message.FeedbackMessage[]
getMessages()
boolean
hasErrors()
boolean
hasWarnings()
static Feedback
info(String description)
Creates an instance with a single info message.static Feedback
info(String description, String detail)
Creates an instance with a single info message.boolean
isEmpty()
Determines whether this instance has messages.void
setMessages(FeedbackMessage[] messages)
static Feedback
success(String description)
Creates an instance with a single success message.static Feedback
success(String description, String detail)
Creates an instance with a single success message.static Feedback
warning(String description)
Creates an instance with a single warning message.static Feedback
warning(String description, String detail)
Creates an instance with a single warning message.-
Methods inherited from class org.eclipse.lyo.oslc4j.core.model.AbstractResource
addType, getAbout, getExtendedProperties, getTypes, setAbout, setExtendedProperties, setTypes
-
-
-
-
Method Detail
-
info
public static Feedback info(String description)
Creates an instance with a single info message.- Parameters:
description
- message description.- Returns:
- the feedback reference.
- Since:
- 3.1.0
-
info
public static Feedback info(String description, String detail)
Creates an instance with a single info message.- Parameters:
description
- message description.detail
- message detail.- Returns:
- the feedback reference.
- Since:
- 3.5.0
-
success
public static Feedback success(String description)
Creates an instance with a single success message.- Parameters:
description
- message description.- Returns:
- the feedback reference.
- Since:
- 3.1.0
-
success
public static Feedback success(String description, String detail)
Creates an instance with a single success message.- Parameters:
description
- message description.detail
- message detail.- Returns:
- the feedback reference.
- Since:
- 3.5.0
-
warning
public static Feedback warning(String description)
Creates an instance with a single warning message.- Parameters:
description
- message description.- Returns:
- the feedback reference.
- Since:
- 3.1.0
-
warning
public static Feedback warning(String description, String detail)
Creates an instance with a single warning message.- Parameters:
description
- message description.detail
- message detail.- Returns:
- the feedback reference.
- Since:
- 3.5.0
-
error
public static Feedback error(String description)
Creates an instance with a single error message.- Parameters:
description
- message description.- Returns:
- the feedback reference.
- Since:
- 3.1.0
-
error
public static Feedback error(String description, String detail)
Creates an instance with a single error message.- Parameters:
description
- message description.detail
- message detail.- Returns:
- the feedback reference.
- Since:
- 3.5.0
-
getMessages
@OslcName("message") @OslcPropertyDefinition("http://www.sodius.com/ns/feedback#message") @OslcTitle("Messages") @OslcRepresentation(Inline) @OslcRdfCollectionType(collectionType="Seq") @OslcValueType(LocalResource) public FeedbackMessage[] getMessages()
-
addMessage
public void addMessage(FeedbackMessage message)
-
setMessages
public void setMessages(FeedbackMessage[] messages)
-
hasWarnings
public boolean hasWarnings()
-
hasErrors
public boolean hasErrors()
-
isEmpty
public boolean isEmpty()
Determines whether this instance has messages.- Returns:
true
if this instance has messages;false
otherwise.- Since:
- 3.5.0
-
-