This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface NonNullableMutableMap<K,V> : MutableMap<K,V> { | |
override fun get(key: K): V | |
operator fun set(key: K, value: V) = put(key, value) | |
} | |
fun <K,V> MutableMap<K,V>.withoutNullValues(default: () -> V): NonNullableMutableMap<K, V> { | |
if (this is NonNullableMutableMap) return this | |
return NonNullableMapWrapper(this, default) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.amazonaws.regions.RegionUtils; | |
import com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient; | |
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper; | |
import com.amazonaws.services.dynamodbv2.model.GlobalSecondaryIndex; | |
import com.amazonaws.services.dynamodbv2.model.Projection; | |
import com.amazonaws.services.dynamodbv2.model.ProjectionType; | |
import com.amazonaws.services.dynamodbv2.model.ProvisionedThroughput; | |
import com.amazonaws.services.dynamodbv2.model.ResourceNotFoundException; | |
import com.amazonaws.auth.AWSCredentials; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static int lighten(int color, double fraction) { | |
int red = Color.red(color); | |
int green = Color.green(color); | |
int blue = Color.blue(color); | |
red = lightenColor(red, fraction); | |
green = lightenColor(green, fraction); | |
blue = lightenColor(blue, fraction); | |
int alpha = Color.alpha(color); | |
return Color.argb(alpha, red, green, blue); | |
} |