Documentation and interface tweaks.
This commit is contained in:
@@ -80,6 +80,9 @@ public interface MPSite<Q extends MPQuestion> extends Comparable<MPSite<?>> {
|
||||
String getResult(MPKeyPurpose keyPurpose, @Nullable String keyContext, @Nullable String state)
|
||||
throws MPKeyUnavailableException, MPAlgorithmException;
|
||||
|
||||
/**
|
||||
* @see MPMasterKey#siteResult(String, MPAlgorithm, UnsignedInteger, MPKeyPurpose, String, MPResultType, String)
|
||||
*/
|
||||
@Nullable
|
||||
String getResult(MPKeyPurpose keyPurpose, @Nullable String keyContext,
|
||||
@Nullable UnsignedInteger counter, MPResultType type, @Nullable String state)
|
||||
@@ -90,13 +93,13 @@ public interface MPSite<Q extends MPQuestion> extends Comparable<MPSite<?>> {
|
||||
@Nullable UnsignedInteger counter, MPResultType type, String state)
|
||||
throws MPKeyUnavailableException, MPAlgorithmException;
|
||||
|
||||
@Nonnull
|
||||
@Nullable
|
||||
default String getLogin()
|
||||
throws MPKeyUnavailableException, MPAlgorithmException {
|
||||
return getLogin( null );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Nullable
|
||||
String getLogin(@Nullable String state)
|
||||
throws MPKeyUnavailableException, MPAlgorithmException;
|
||||
|
||||
|
@@ -62,12 +62,16 @@ public abstract class MPBasicSite<U extends MPUser<?>, Q extends MPQuestion> ext
|
||||
this.loginType = (loginType != null)? loginType: this.algorithm.mpw_default_login_type();
|
||||
}
|
||||
|
||||
// - Meta
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getSiteName() {
|
||||
return siteName;
|
||||
}
|
||||
|
||||
// - Algorithm
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public MPAlgorithm getAlgorithm() {
|
||||
@@ -158,7 +162,7 @@ public abstract class MPBasicSite<U extends MPUser<?>, Q extends MPQuestion> ext
|
||||
keyPurpose, keyContext, type, state );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Nullable
|
||||
@Override
|
||||
public String getLogin(@Nullable final String state)
|
||||
throws MPKeyUnavailableException, MPAlgorithmException {
|
||||
@@ -166,6 +170,14 @@ public abstract class MPBasicSite<U extends MPUser<?>, Q extends MPQuestion> ext
|
||||
return getResult( MPKeyPurpose.Identification, null, null, getLoginType(), state );
|
||||
}
|
||||
|
||||
// - Relations
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public U getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Q addQuestion(final Q question) {
|
||||
@@ -200,12 +212,6 @@ public abstract class MPBasicSite<U extends MPUser<?>, Q extends MPQuestion> ext
|
||||
return results.build();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public U getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onChanged() {
|
||||
super.onChanged();
|
||||
|
@@ -101,7 +101,7 @@ public class MPFileSite extends MPBasicSite<MPFileUser, MPFileQuestion> {
|
||||
return getResult( keyPurpose, keyContext, getResultState() );
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Nullable
|
||||
@Override
|
||||
public String getLogin()
|
||||
throws MPKeyUnavailableException, MPAlgorithmException {
|
||||
|
Reference in New Issue
Block a user