Skip to content

Commit

Permalink
JavaDoc for Container classes
Browse files Browse the repository at this point in the history
Removed unused ones
  • Loading branch information
Javinator9889 committed Oct 27, 2018
1 parent 2adc20c commit 5d9a4b4
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 127 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.concurrent.Future;

/**
* Class for containing <code>Future</code> objects that will be used on each app first start
* Created by Javinator9889 on 03/10/2018.
*/
public class SingletonFutureContainer {
Expand All @@ -11,33 +12,87 @@ public class SingletonFutureContainer {
private Future<CharSequence> mLicenseText;
private Future<CharSequence> mToSText;

/**
* Default synchronized constructor which returns a generated instance (or a new one)
*
* @return {@link #INSTANCE} if existing, else new one
*/
public static synchronized SingletonFutureContainer getInstance() {
if (INSTANCE == null)
INSTANCE = new SingletonFutureContainer();
return INSTANCE;
}

/**
* Obtains the privacy text stored
*
* @return <code>Future</code> with the text
* @throws NullPointerException when there is no text stored
*/
public Future<CharSequence> getPrivacyText() {
if (mPrivacyText == null)
throw new NullPointerException("There is no privacy text future object stored");
return mPrivacyText;
}

/**
* Sets the privacy text future object
*
* @param privacyText future text to store
* @throws NullPointerException when the <code>privacyText</code> is <code>null</code>
*/
public void setPrivacyText(Future<CharSequence> privacyText) {
if (privacyText == null)
throw new NullPointerException("privacyText is null");
this.mPrivacyText = privacyText;
}

/**
* Obtains the license text stored
*
* @return <code>Future</code> with the text
* @throws NullPointerException when there is no text stored
*/
public Future<CharSequence> getLicenseText() {
if (mPrivacyText == null)
throw new NullPointerException("There is no license text future object stored");
return mLicenseText;
}

/**
* Sets the license text future object
*
* @param licenseText future text to store
* @throws NullPointerException when the <code>licenseText</code> is <code>null</code>
*/
public void setLicenseText(Future<CharSequence> licenseText) {
if (licenseText == null)
throw new NullPointerException("licenseText is null");
this.mLicenseText = licenseText;
}

/**
* Obtains the terms of service text stored
*
* @return <code>Future</code> with the text
* @throws NullPointerException when there is no text stored
*/
public Future<CharSequence> getToSText() {
if (mPrivacyText == null)
throw new NullPointerException("There is no terms of service text future object " +
"stored");
return mToSText;
}

/**
* Sets the license text future object
*
* @param toSText future text to store
* @throws NullPointerException when the <code>toSText</code> is <code>null</code>
*/
public void setToSText(Future<CharSequence> toSText) {
if (toSText == null)
throw new NullPointerException("toSText is null");
this.mToSText = toSText;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import androidx.annotation.FontRes;

/**
* Class for containing <code>Typeface</code> for
* {@link com.github.paolorotolo.appintro.model.SliderPage}
* Created by Javinator9889 on 12/10/2018.
*/
public class SlidesTypefacesContainer {
Expand All @@ -11,16 +13,35 @@ public class SlidesTypefacesContainer {
private @FontRes
int mDescriptionTypeface;

/**
* Public available constructor for saving the <code>Typeface</code>s
*
* @param titleTypeface title custom typeface (must be a @FontRes)
* @param descriptionTypeface description custom typeface (must be a @FontRes)
* @see FontRes
*/
public SlidesTypefacesContainer(@FontRes int titleTypeface, @FontRes int descriptionTypeface) {
this.mTitleTypeface = titleTypeface;
this.mDescriptionTypeface = descriptionTypeface;
}

/**
* Obtains the stored title <code>Typeface</code>
*
* @return <code>int</code> with the @FontRes typeface
* @see FontRes
*/
@FontRes
public int getTitleTypeface() {
return mTitleTypeface;
}

/**
* Obtains the stored description <code>Typeface</code>
*
* @return <code>int</code> with the @FontRes typeface
* @see FontRes
*/
@FontRes
public int getDescriptionTypeface() {
return mDescriptionTypeface;
Expand Down

This file was deleted.

0 comments on commit 5d9a4b4

Please sign in to comment.