Skip to content

Commit

Permalink
Made "ID" field accessible
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Dec 4, 2020
1 parent a0c5b99 commit 7686866
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,22 @@ public abstract class AbstractSVRLMessage implements Serializable
{
protected ICommonsList <DiagnosticReference> m_aDiagnosticReferences;
protected String m_sText;
protected String m_sID;
protected String m_sLocation;
protected String m_sTest;
protected String m_sRole;
protected IErrorLevel m_aFlag;

public AbstractSVRLMessage (@Nullable final List <DiagnosticReference> aDiagnosticReferences,
@Nullable final String sID,
@Nullable final String sText,
@Nullable final String sLocation,
@Nullable final String sTest,
@Nullable final String sRole,
@Nullable final IErrorLevel aFlag)
{
m_aDiagnosticReferences = new CommonsArrayList <> (aDiagnosticReferences);
m_sID = StringHelper.trim (sID);
m_sText = StringHelper.trim (sText);
m_sLocation = sLocation;
m_sTest = sTest;
Expand All @@ -64,37 +67,43 @@ public AbstractSVRLMessage (@Nullable final List <DiagnosticReference> aDiagnost

@Nonnull
@ReturnsMutableCopy
public ICommonsList <DiagnosticReference> getDiagnisticReferences ()
public final ICommonsList <DiagnosticReference> getDiagnisticReferences ()
{
return m_aDiagnosticReferences.getClone ();
}

@Nullable
public String getText ()
public final String getID ()
{
return m_sID;
}

@Nullable
public final String getText ()
{
return m_sText;
}

@Nullable
public String getLocation ()
public final String getLocation ()
{
return m_sLocation;
}

@Nullable
public String getTest ()
public final String getTest ()
{
return m_sTest;
}

@Nullable
public String getRole ()
public final String getRole ()
{
return m_sRole;
}

@Nonnull
public IErrorLevel getFlag ()
public final IErrorLevel getFlag ()
{
return m_aFlag;
}
Expand All @@ -103,6 +112,7 @@ public IErrorLevel getFlag ()
public SVRLResourceError getAsResourceError (@Nullable final String sResourceName)
{
return new SVRLErrorBuilder (m_sTest).setErrorLevel (m_aFlag)
.setErrorID (m_sID)
.setErrorFieldName (m_sLocation)
.setErrorLocation (new SimpleLocation (sResourceName))
.setErrorText (m_sText)
Expand All @@ -112,12 +122,13 @@ public SVRLResourceError getAsResourceError (@Nullable final String sResourceNam
@Override
public String toString ()
{
return new ToStringGenerator (this).append ("diagnosticRefs", m_aDiagnosticReferences)
.append ("text", m_sText)
.append ("location", m_sLocation)
.append ("test", m_sTest)
.appendIfNotNull ("role", m_sRole)
.append ("flag", m_aFlag)
return new ToStringGenerator (this).append ("DiagnosticRefs", m_aDiagnosticReferences)
.append ("ID", m_sID)
.append ("Text", m_sText)
.append ("Location", m_sLocation)
.append ("Test", m_sTest)
.appendIfNotNull ("Role", m_sRole)
.append ("Flag", m_aFlag)
.getToString ();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public SVRLFailedAssert (@Nonnull final FailedAssert aFailedAssert,
@Nonnull final Function <? super FailedAssert, ? extends IErrorLevel> aErrLevelProvider)
{
super (aFailedAssert.getDiagnosticReference (),
aFailedAssert.getId (),
SVRLHelper.getAsString (aFailedAssert.getText ()),
aLocationProvider.apply (aFailedAssert),
aFailedAssert.getTest (),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public SVRLSuccessfulReport (@Nonnull final SuccessfulReport aSuccessfulReport,
@Nonnull final Function <? super SuccessfulReport, ? extends IErrorLevel> aErrLevelProvider)
{
super (aSuccessfulReport.getDiagnosticReference (),
aSuccessfulReport.getId (),
SVRLHelper.getAsString (aSuccessfulReport.getText ()),
aLocationProvider.apply (aSuccessfulReport),
aSuccessfulReport.getTest (),
Expand Down

0 comments on commit 7686866

Please sign in to comment.