Every time I format the drive and perform a clean install of the SO, I end up searching for my favorite stuff. This file tries to sum up my setup.
Download Chrome.
Also install the latest JDK (Java Development Kit).
package com.lbalmaceda.genericsproject; | |
import com.lbalmaceda.genericsproject.exceptions.CustomException; | |
/** | |
* Created by lbalmaceda on 6/21/16. | |
*/ | |
public interface CustomCallback<T, U extends CustomException> { | |
void onSuccess(T response); |
At first, I wanted AuthenticationError to be a class not extending any Exception class. It received the Map<Object, String> and the Throwable to keep the error stack.
Then I've found that many calls from our *Request
classes instantiated a new Auth0Exception giving a simple message like "cannot parse this JSON" or "invalid response" instead of the values map, so I needed to add that String as another parameter. Maybe in a second constructor.
It seems better to extend Auth0Exception
so the default getMessage()
and getCause()
were there already. I thought about creating an interface AuthenticationError
with the common error methods, like getError()
, getDescription()
and the rest of the values inside a map getValues()
. So I ended up with a class that extends Auth0Exception and implements AuthenticationError. ---> AuthenticationException
.
I tried making the callback.onFailure
return an AuthenticationError
(interface) ob
public class CustomField implements Parcelable { | |
private static final int CAP_SENTENCES = 0; | |
private static final int CAP_WORDS = 1; | |
private static final int CAP_CHARACTERS = 2; | |
private static final int MAX_ALLOWED_LENGTH = 100; | |
private int cap; | |
private int maxLength; | |
private boolean onlyNumbers; | |
private boolean hideInput; |
/* | |
* PermissionHandlerActivity.java | |
* | |
* Copyright (c) 2016 Auth0 (http://auth0.com) | |
* | |
* 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 |