repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/enums/PreferencesMode.java // public enum PreferencesMode { // // /** // * Default. // * // * @see android.content.Context#MODE_PRIVATE // */ // MODE_PRIVATE(Context.MODE_PRIVATE), // // /** // * @see android.content...
import android.app.Activity; import android.content.Context; import android.text.TextUtils; import net.orange_box.storebox.annotations.option.SaveOption; import net.orange_box.storebox.annotations.type.ActivityPreferences; import net.orange_box.storebox.annotations.type.DefaultSharedPreferences; import net.orange_box.s...
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/enums/PreferencesMode.java // public enum PreferencesMode { // // /** // * Default. // * // * @see android.content.Context#MODE_PRIVATE // */ // MODE_PRIVATE(Context.MODE_PRIVATE), // // /** // * @see android.content...
private PreferencesMode preferencesMode = PreferencesMode.MODE_PRIVATE;
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/enums/PreferencesMode.java // public enum PreferencesMode { // // /** // * Default. // * // * @see android.content.Context#MODE_PRIVATE // */ // MODE_PRIVATE(Context.MODE_PRIVATE), // // /** // * @see android.content...
import android.app.Activity; import android.content.Context; import android.text.TextUtils; import net.orange_box.storebox.annotations.option.SaveOption; import net.orange_box.storebox.annotations.type.ActivityPreferences; import net.orange_box.storebox.annotations.type.DefaultSharedPreferences; import net.orange_box.s...
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/enums/PreferencesMode.java // public enum PreferencesMode { // // /** // * Default. // * // * @see android.content.Context#MODE_PRIVATE // */ // MODE_PRIVATE(Context.MODE_PRIVATE), // // /** // * @see android.content...
private SaveMode saveMode = SaveMode.APPLY;
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/adapters/base/BaseStringSetTypeAdapter.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
import android.annotation.TargetApi; import android.os.Build; import android.support.annotation.Nullable; import net.orange_box.storebox.adapters.StoreBoxTypeAdapter; import net.orange_box.storebox.adapters.StoreType; import java.util.Set;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
StoreBoxTypeAdapter<T, Set<String>> {
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/adapters/base/BaseStringSetTypeAdapter.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
import android.annotation.TargetApi; import android.os.Build; import android.support.annotation.Nullable; import net.orange_box.storebox.adapters.StoreBoxTypeAdapter; import net.orange_box.storebox.adapters.StoreType; import java.util.Set;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
public final StoreType getStoreType() {
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/adapters/base/BaseStringTypeAdapter.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
import android.support.annotation.Nullable; import net.orange_box.storebox.adapters.StoreBoxTypeAdapter; import net.orange_box.storebox.adapters.StoreType;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
public final StoreType getStoreType() {
martino2k6/StoreBox
examples/proguard/src/main/java/net/orange_box/storebox/example/proguard/Preferences.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/listeners/OnPreferenceValueChangedListener.java // public interface OnPreferenceValueChangedListener<T> { // // void onChanged(T newValue); // }
import net.orange_box.storebox.annotations.method.ClearMethod; import net.orange_box.storebox.annotations.method.DefaultValue; import net.orange_box.storebox.annotations.method.KeyByResource; import net.orange_box.storebox.annotations.method.KeyByString; import net.orange_box.storebox.annotations.method.RegisterChangeL...
package net.orange_box.storebox.example.proguard; @ActivityPreferences interface Preferences { @KeyByString("int") @DefaultValue(R.integer.default_int) int getInt(); @KeyByResource(R.string.key_int) void setInt(int value); @RegisterChangeListenerMethod @KeyByString("int")
// Path: storebox-lib/src/main/java/net/orange_box/storebox/listeners/OnPreferenceValueChangedListener.java // public interface OnPreferenceValueChangedListener<T> { // // void onChanged(T newValue); // } // Path: examples/proguard/src/main/java/net/orange_box/storebox/example/proguard/Preferences.java impor...
void regIntListener(OnPreferenceValueChangedListener<Integer> listener);
martino2k6/StoreBox
storebox-harness/src/main/java/net/orange_box/storebox/harness/interfaces/changes/ChangeListenersInterface.java
// Path: storebox-harness/src/main/java/net/orange_box/storebox/harness/types/CustomClass.java // public class CustomClass { // // private int hashCode; // // private final String one; // private final String two; // // public CustomClass() { // this("", ""); // } // // ...
import net.orange_box.storebox.annotations.method.KeyByString; import net.orange_box.storebox.annotations.method.TypeAdapter; import net.orange_box.storebox.annotations.method.RegisterChangeListenerMethod; import net.orange_box.storebox.annotations.method.UnregisterChangeListenerMethod; import net.orange_box.storebox.h...
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-harness/src/main/java/net/orange_box/storebox/harness/types/CustomClass.java // public class CustomClass { // // private int hashCode; // // private final String one; // private final String two; // // public CustomClass() { // this("", ""); // } // // ...
OnPreferenceValueChangedListener<Integer> listener);
martino2k6/StoreBox
storebox-harness/src/main/java/net/orange_box/storebox/harness/interfaces/changes/ChangeListenersInterface.java
// Path: storebox-harness/src/main/java/net/orange_box/storebox/harness/types/CustomClass.java // public class CustomClass { // // private int hashCode; // // private final String one; // private final String two; // // public CustomClass() { // this("", ""); // } // // ...
import net.orange_box.storebox.annotations.method.KeyByString; import net.orange_box.storebox.annotations.method.TypeAdapter; import net.orange_box.storebox.annotations.method.RegisterChangeListenerMethod; import net.orange_box.storebox.annotations.method.UnregisterChangeListenerMethod; import net.orange_box.storebox.h...
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-harness/src/main/java/net/orange_box/storebox/harness/types/CustomClass.java // public class CustomClass { // // private int hashCode; // // private final String one; // private final String two; // // public CustomClass() { // this("", ""); // } // // ...
@TypeAdapter(CustomClassTypeAdapter.class)
martino2k6/StoreBox
storebox-harness/src/main/java/net/orange_box/storebox/harness/interfaces/changes/ChangeListenersInterface.java
// Path: storebox-harness/src/main/java/net/orange_box/storebox/harness/types/CustomClass.java // public class CustomClass { // // private int hashCode; // // private final String one; // private final String two; // // public CustomClass() { // this("", ""); // } // // ...
import net.orange_box.storebox.annotations.method.KeyByString; import net.orange_box.storebox.annotations.method.TypeAdapter; import net.orange_box.storebox.annotations.method.RegisterChangeListenerMethod; import net.orange_box.storebox.annotations.method.UnregisterChangeListenerMethod; import net.orange_box.storebox.h...
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-harness/src/main/java/net/orange_box/storebox/harness/types/CustomClass.java // public class CustomClass { // // private int hashCode; // // private final String one; // private final String two; // // public CustomClass() { // this("", ""); // } // // ...
void setCustomClass(CustomClass value);
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/utils/PreferenceUtils.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreType.java // public enum StoreType { // // BOOLEAN, // FLOAT, // INTEGER, // LONG, // STRING, // STRING_SET // } // // Path: storebox-lib/src/main/java/net/orange_box/storebox/enums/SaveMode.java // public enum SaveM...
import android.annotation.TargetApi; import android.content.SharedPreferences; import android.os.Build; import net.orange_box.storebox.adapters.StoreType; import net.orange_box.storebox.enums.SaveMode; import java.util.Locale; import java.util.Set;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreType.java // public enum StoreType { // // BOOLEAN, // FLOAT, // INTEGER, // LONG, // STRING, // STRING_SET // } // // Path: storebox-lib/src/main/java/net/orange_box/storebox/enums/SaveMode.java // public enum SaveM...
StoreType type,
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/utils/PreferenceUtils.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreType.java // public enum StoreType { // // BOOLEAN, // FLOAT, // INTEGER, // LONG, // STRING, // STRING_SET // } // // Path: storebox-lib/src/main/java/net/orange_box/storebox/enums/SaveMode.java // public enum SaveM...
import android.annotation.TargetApi; import android.content.SharedPreferences; import android.os.Build; import net.orange_box.storebox.adapters.StoreType; import net.orange_box.storebox.enums.SaveMode; import java.util.Locale; import java.util.Set;
break; case INTEGER: editor.putInt(key, (Integer) value); break; case LONG: editor.putLong(key, (Long) value); break; case STRING: editor.putString(k...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreType.java // public enum StoreType { // // BOOLEAN, // FLOAT, // INTEGER, // LONG, // STRING, // STRING_SET // } // // Path: storebox-lib/src/main/java/net/orange_box/storebox/enums/SaveMode.java // public enum SaveM...
SaveMode mode) {
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/adapters/base/BaseFloatTypeAdapter.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
import net.orange_box.storebox.adapters.StoreBoxTypeAdapter; import net.orange_box.storebox.adapters.StoreType;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
public final StoreType getStoreType() {
martino2k6/StoreBox
storebox-harness/src/androidTest/java/net/orange_box/storebox/harness/base/PreferencesTestCase.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java // public final class StoreBox { // // /** // * @param context - the context under which the // * {@link android.content.SharedPreferences} should be opened // * @param cls - the interface class which should be instantiated //...
import android.annotation.SuppressLint; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.test.InstrumentationTestCase; import net.orange_box.storebox.StoreBox;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java // public final class StoreBox { // // /** // * @param context - the context under which the // * {@link android.content.SharedPreferences} should be opened // * @param cls - the interface class which should be instantiated //...
uut = StoreBox.create(
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/annotations/option/SaveOption.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/enums/SaveMode.java // public enum SaveMode { // // /** // * Default. // * // * @see android.content.SharedPreferences.Editor#apply() // */ // APPLY, // // /** // * @see android.content.SharedPreferences.Editor#commit() /...
import net.orange_box.storebox.enums.SaveMode; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/enums/SaveMode.java // public enum SaveMode { // // /** // * Default. // * // * @see android.content.SharedPreferences.Editor#apply() // */ // APPLY, // // /** // * @see android.content.SharedPreferences.Editor#commit() /...
SaveMode value();
martino2k6/StoreBox
storebox-harness/src/androidTest/java/net/orange_box/storebox/harness/ForwardingMethodsTestCase.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java // public final class StoreBox { // // /** // * @param context - the context under which the // * {@link android.content.SharedPreferences} should be opened // * @param cls - the interface class which should be instantiated //...
import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.annotation.SuppressLint; import android.app.Instrumentation; import android.content.ContextWrapper; import android.content.Intent; import android.content.SharedPreferences; import android.test.ActivityUnitTestCase; import a...
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java // public final class StoreBox { // // /** // * @param context - the context under which the // * {@link android.content.SharedPreferences} should be opened // * @param cls - the interface class which should be instantiated //...
private ForwardingMethodsInterface uut;
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/adapters/base/BaseLongTypeAdapter.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
import net.orange_box.storebox.adapters.StoreBoxTypeAdapter; import net.orange_box.storebox.adapters.StoreType;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
public final StoreType getStoreType() {
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/annotations/method/TypeAdapter.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // }
import net.orange_box.storebox.adapters.StoreBoxTypeAdapter; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // Path...
Class<? extends StoreBoxTypeAdapter> value();
martino2k6/StoreBox
examples/proguard/src/main/java/net/orange_box/storebox/example/proguard/MainActivity.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java // public final class StoreBox { // // /** // * @param context - the context under which the // * {@link android.content.SharedPreferences} should be opened // * @param cls - the interface class which should be instantiated //...
import android.app.Activity; import android.os.Bundle; import net.orange_box.storebox.StoreBox; import net.orange_box.storebox.listeners.OnPreferenceValueChangedListener; import java.util.concurrent.atomic.AtomicInteger;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java // public final class StoreBox { // // /** // * @param context - the context under which the // * {@link android.content.SharedPreferences} should be opened // * @param cls - the interface class which should be instantiated //...
final Preferences prefs = StoreBox.create(this, Preferences.class);
martino2k6/StoreBox
examples/proguard/src/main/java/net/orange_box/storebox/example/proguard/MainActivity.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java // public final class StoreBox { // // /** // * @param context - the context under which the // * {@link android.content.SharedPreferences} should be opened // * @param cls - the interface class which should be instantiated //...
import android.app.Activity; import android.os.Bundle; import net.orange_box.storebox.StoreBox; import net.orange_box.storebox.listeners.OnPreferenceValueChangedListener; import java.util.concurrent.atomic.AtomicInteger;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java // public final class StoreBox { // // /** // * @param context - the context under which the // * {@link android.content.SharedPreferences} should be opened // * @param cls - the interface class which should be instantiated //...
final OnPreferenceValueChangedListener<Integer> listener =
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/annotations/type/ActivityPreferences.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/enums/PreferencesMode.java // public enum PreferencesMode { // // /** // * Default. // * // * @see android.content.Context#MODE_PRIVATE // */ // MODE_PRIVATE(Context.MODE_PRIVATE), // // /** // * @see android.content...
import net.orange_box.storebox.enums.PreferencesMode; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/enums/PreferencesMode.java // public enum PreferencesMode { // // /** // * Default. // * // * @see android.content.Context#MODE_PRIVATE // */ // MODE_PRIVATE(Context.MODE_PRIVATE), // // /** // * @see android.content...
PreferencesMode mode() default PreferencesMode.MODE_PRIVATE;
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/adapters/base/BaseBooleanTypeAdapter.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
import net.orange_box.storebox.adapters.StoreBoxTypeAdapter; import net.orange_box.storebox.adapters.StoreType;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
public final StoreType getStoreType() {
martino2k6/StoreBox
storebox-harness/src/androidTest/java/net/orange_box/storebox/harness/RemoveMethodTestCase.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java // public final class StoreBox { // // /** // * @param context - the context under which the // * {@link android.content.SharedPreferences} should be opened // * @param cls - the interface class which should be instantiated //...
import android.annotation.SuppressLint; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.test.InstrumentationTestCase; import android.test.suitebuilder.annotation.SmallTest; import net.orange_box.storebox.StoreBox; import net.orange_box.storebox.harness.interfaces.Re...
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java // public final class StoreBox { // // /** // * @param context - the context under which the // * {@link android.content.SharedPreferences} should be opened // * @param cls - the interface class which should be instantiated //...
private RemoveMethodInterface uut;
martino2k6/StoreBox
storebox-harness/src/androidTest/java/net/orange_box/storebox/harness/RemoveMethodTestCase.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java // public final class StoreBox { // // /** // * @param context - the context under which the // * {@link android.content.SharedPreferences} should be opened // * @param cls - the interface class which should be instantiated //...
import android.annotation.SuppressLint; import android.content.SharedPreferences; import android.preference.PreferenceManager; import android.test.InstrumentationTestCase; import android.test.suitebuilder.annotation.SmallTest; import net.orange_box.storebox.StoreBox; import net.orange_box.storebox.harness.interfaces.Re...
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/StoreBox.java // public final class StoreBox { // // /** // * @param context - the context under which the // * {@link android.content.SharedPreferences} should be opened // * @param cls - the interface class which should be instantiated //...
uut = StoreBox.create(
martino2k6/StoreBox
storebox-lib/src/main/java/net/orange_box/storebox/adapters/base/BaseIntegerTypeAdapter.java
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
import net.orange_box.storebox.adapters.StoreBoxTypeAdapter; import net.orange_box.storebox.adapters.StoreType;
/* * Copyright 2015 Martin Bella * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: storebox-lib/src/main/java/net/orange_box/storebox/adapters/StoreBoxTypeAdapter.java // public interface StoreBoxTypeAdapter<F, T> { // // StoreType getStoreType(); // // T getDefaultValue(); // // T adaptForPreferences(F value); // // F adaptFromPreferences(T value); // } // // Pa...
public final StoreType getStoreType() {
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/model/zone/DuelZone.java
// Path: src/main/java/com/zhaidaosi/game/server/model/player/Player.java // public class Player extends BasePlayer { // // private static Map<Integer, Integer> levelExperience = new HashMap<>(); // // private UserInfo userInfo; // private BasePosition oldPosition; // private Map<String, Integer> acti...
import com.zhaidaosi.game.jgframework.model.area.BaseZone; import com.zhaidaosi.game.server.model.player.Player;
package com.zhaidaosi.game.server.model.zone; public class DuelZone extends BaseZone { public final static String ZONE_NAME = "DuelZone"; public DuelZone() { super(ZONE_NAME); } @Override public void init() { }
// Path: src/main/java/com/zhaidaosi/game/server/model/player/Player.java // public class Player extends BasePlayer { // // private static Map<Integer, Integer> levelExperience = new HashMap<>(); // // private UserInfo userInfo; // private BasePosition oldPosition; // private Map<String, Integer> acti...
public void addPlayer(Player player) {
bupt1987/JgWeb
src/test/java/client/TestSocket.java
// Path: src/test/java/model/AuthResult.java // public class AuthResult { // public String address; // public String secret; // // public AuthResult(String address, String secret) { // this.address = address; // this.secret = secret; // } // }
import com.zhaidaosi.game.jgframework.common.BaseSocket; import com.zhaidaosi.game.jgframework.message.InMessage; import com.zhaidaosi.game.jgframework.session.SessionManager; import model.AuthResult; import java.net.URI;
package client; class TestSocket { public static void main(String[] args) { long startTime = System.currentTimeMillis(); System.out.println("start time : " + startTime); for (int i = 1; i <= 100; i++) { MyThread t = new MyThread("test" + i, "123456"); t.start(); ...
// Path: src/test/java/model/AuthResult.java // public class AuthResult { // public String address; // public String secret; // // public AuthResult(String address, String secret) { // this.address = address; // this.secret = secret; // } // } // Path: src/test/java/client/Te...
AuthResult ar = TestAuth.auth(username, password);
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/handler/OnlineUserHandler.java
// Path: src/main/java/com/zhaidaosi/game/server/model/area/Area.java // public class Area extends BaseArea { // // public static int ID = 1; // // public Area() { // super(ID, "场景一"); // } // // @Override // public void init() { // // } // // }
import com.zhaidaosi.game.jgframework.handler.BaseHandler; import com.zhaidaosi.game.jgframework.message.IBaseMessage; import com.zhaidaosi.game.jgframework.message.InMessage; import com.zhaidaosi.game.jgframework.message.OutMessage; import com.zhaidaosi.game.jgframework.model.area.AreaManager; import com.zhaidaosi.gam...
package com.zhaidaosi.game.server.handler; public class OnlineUserHandler extends BaseHandler { @Override public IBaseMessage run(InMessage im, Channel ch) {
// Path: src/main/java/com/zhaidaosi/game/server/model/area/Area.java // public class Area extends BaseArea { // // public static int ID = 1; // // public Area() { // super(ID, "场景一"); // } // // @Override // public void init() { // // } // // } // Path: src/main/jav...
Area area = (Area) AreaManager.getArea(Area.ID);
bupt1987/JgWeb
src/test/java/client/TestWebSocket.java
// Path: src/test/java/model/AuthResult.java // public class AuthResult { // public String address; // public String secret; // // public AuthResult(String address, String secret) { // this.address = address; // this.secret = secret; // } // } // // Path: src/test/java/model/M...
import com.zhaidaosi.game.jgframework.message.InMessage; import com.zhaidaosi.game.jgframework.session.SessionManager; import model.AuthResult; import model.MyWebSocketClient; import org.java_websocket.drafts.Draft_17; import java.net.URI;
package client; public class TestWebSocket { private final URI uri; private String secret; TestWebSocket(URI uri, String secret) { this.uri = uri; this.secret = secret; } void run() throws Exception { long startTime = System.currentTimeMillis();
// Path: src/test/java/model/AuthResult.java // public class AuthResult { // public String address; // public String secret; // // public AuthResult(String address, String secret) { // this.address = address; // this.secret = secret; // } // } // // Path: src/test/java/model/M...
MyWebSocketClient ch = new MyWebSocketClient(uri, new Draft_17());
bupt1987/JgWeb
src/test/java/client/TestWebSocket.java
// Path: src/test/java/model/AuthResult.java // public class AuthResult { // public String address; // public String secret; // // public AuthResult(String address, String secret) { // this.address = address; // this.secret = secret; // } // } // // Path: src/test/java/model/M...
import com.zhaidaosi.game.jgframework.message.InMessage; import com.zhaidaosi.game.jgframework.session.SessionManager; import model.AuthResult; import model.MyWebSocketClient; import org.java_websocket.drafts.Draft_17; import java.net.URI;
ch.closeBlocking(); } long endTime = System.currentTimeMillis(); System.out.println("end time : " + endTime + " | run time :" + (endTime - startTime)); } public static void main(String[] args) throws Exception { long startTime = System.currentTimeMillis(); Sy...
// Path: src/test/java/model/AuthResult.java // public class AuthResult { // public String address; // public String secret; // // public AuthResult(String address, String secret) { // this.address = address; // this.secret = secret; // } // } // // Path: src/test/java/model/M...
AuthResult ar = TestAuth.auth(username, password);
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/rsync/UserRsync.java
// Path: src/main/java/com/zhaidaosi/game/server/sdm/model/User.java // @SuppressWarnings("serial") // @Entity // @Table(name = "user", catalog = "jgframework") // public class User extends BaseModel { // // // Fields // // private Integer id; // private String username; // private String password; //...
import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.zhaidaosi.game.jgframework.common.sdm.IBaseModel; import com.zhaidaosi.game.jgframework.common.spring.ServiceManager; import com.zhaidaosi.game.jgframework.rsync.BaseRsync; import com.zhaidaosi.game.server.sdm.model.User; i...
package com.zhaidaosi.game.server.rsync; public class UserRsync extends BaseRsync { private static final Logger log = LoggerFactory.getLogger(UserRsync.class); @Override public void runRsync() {
// Path: src/main/java/com/zhaidaosi/game/server/sdm/model/User.java // @SuppressWarnings("serial") // @Entity // @Table(name = "user", catalog = "jgframework") // public class User extends BaseModel { // // // Fields // // private Integer id; // private String username; // private String password; //...
UserService service = (UserService) ServiceManager.getService(UserService.BEAN_ID);
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/rsync/UserRsync.java
// Path: src/main/java/com/zhaidaosi/game/server/sdm/model/User.java // @SuppressWarnings("serial") // @Entity // @Table(name = "user", catalog = "jgframework") // public class User extends BaseModel { // // // Fields // // private Integer id; // private String username; // private String password; //...
import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.zhaidaosi.game.jgframework.common.sdm.IBaseModel; import com.zhaidaosi.game.jgframework.common.spring.ServiceManager; import com.zhaidaosi.game.jgframework.rsync.BaseRsync; import com.zhaidaosi.game.server.sdm.model.User; i...
package com.zhaidaosi.game.server.rsync; public class UserRsync extends BaseRsync { private static final Logger log = LoggerFactory.getLogger(UserRsync.class); @Override public void runRsync() { UserService service = (UserService) ServiceManager.getService(UserService.BEAN_ID); ...
// Path: src/main/java/com/zhaidaosi/game/server/sdm/model/User.java // @SuppressWarnings("serial") // @Entity // @Table(name = "user", catalog = "jgframework") // public class User extends BaseModel { // // // Fields // // private Integer id; // private String username; // private String password; //...
User user = (User) entry.getValue();
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/model/Duel.java
// Path: src/main/java/com/zhaidaosi/game/server/model/player/Player.java // public class Player extends BasePlayer { // // private static Map<Integer, Integer> levelExperience = new HashMap<>(); // // private UserInfo userInfo; // private BasePosition oldPosition; // private Map<String, Integer> acti...
import java.util.HashMap; import java.util.Map; import java.util.Random; import com.zhaidaosi.game.jgframework.handler.BaseHandlerChannel; import com.zhaidaosi.game.jgframework.message.OutMessage; import com.zhaidaosi.game.jgframework.model.action.IBaseAction; import com.zhaidaosi.game.jgframework.model.entity.BasePlay...
package com.zhaidaosi.game.server.model; public class Duel { public static final String END = "end"; public static final String INIT = "init"; public static final String MSG = "msg";
// Path: src/main/java/com/zhaidaosi/game/server/model/player/Player.java // public class Player extends BasePlayer { // // private static Map<Integer, Integer> levelExperience = new HashMap<>(); // // private UserInfo userInfo; // private BasePosition oldPosition; // private Map<String, Integer> acti...
public static Player doDuel(Player me, Player target, DuelZone zone, String handlerName) {
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/model/Duel.java
// Path: src/main/java/com/zhaidaosi/game/server/model/player/Player.java // public class Player extends BasePlayer { // // private static Map<Integer, Integer> levelExperience = new HashMap<>(); // // private UserInfo userInfo; // private BasePosition oldPosition; // private Map<String, Integer> acti...
import java.util.HashMap; import java.util.Map; import java.util.Random; import com.zhaidaosi.game.jgframework.handler.BaseHandlerChannel; import com.zhaidaosi.game.jgframework.message.OutMessage; import com.zhaidaosi.game.jgframework.model.action.IBaseAction; import com.zhaidaosi.game.jgframework.model.entity.BasePlay...
package com.zhaidaosi.game.server.model; public class Duel { public static final String END = "end"; public static final String INIT = "init"; public static final String MSG = "msg";
// Path: src/main/java/com/zhaidaosi/game/server/model/player/Player.java // public class Player extends BasePlayer { // // private static Map<Integer, Integer> levelExperience = new HashMap<>(); // // private UserInfo userInfo; // private BasePosition oldPosition; // private Map<String, Integer> acti...
public static Player doDuel(Player me, Player target, DuelZone zone, String handlerName) {
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/BootStart.java
// Path: src/main/java/com/zhaidaosi/game/server/model/player/PlayerFactory.java // public class PlayerFactory implements IBasePlayerFactory { // // public IBaseCharacter getPlayer() { // return new Player(); // } // // }
import javax.servlet.http.HttpServlet; import com.zhaidaosi.game.jgframework.Boot; import com.zhaidaosi.game.server.model.player.PlayerFactory;
package com.zhaidaosi.game.server; @SuppressWarnings("serial") public class BootStart extends HttpServlet { private static void start() { //设置action所在包路径,不设置不扫描 Boot.setActionPackage("com.zhaidaosi.game.server.model.action"); //设置area所在包路径,不设置不扫描 Boot.setAreaPackage("com.zhaidaos...
// Path: src/main/java/com/zhaidaosi/game/server/model/player/PlayerFactory.java // public class PlayerFactory implements IBasePlayerFactory { // // public IBaseCharacter getPlayer() { // return new Player(); // } // // } // Path: src/main/java/com/zhaidaosi/game/server/BootStart.java import javax.s...
Boot.setPlayerFactory(new PlayerFactory());
bupt1987/JgWeb
src/test/java/client/TestMaxUser.java
// Path: src/test/java/model/AuthResult.java // public class AuthResult { // public String address; // public String secret; // // public AuthResult(String address, String secret) { // this.address = address; // this.secret = secret; // } // } // // Path: src/test/java/model/M...
import com.zhaidaosi.game.jgframework.message.InMessage; import com.zhaidaosi.game.jgframework.session.SessionManager; import model.AuthResult; import model.MyWebSocketClient; import org.java_websocket.drafts.Draft_17; import java.net.URI;
package client; public class TestMaxUser { private final URI uri; private String sercret; public TestMaxUser(URI uri, String sercret) { this.uri = uri; this.sercret = sercret; } public void run() throws Exception { long startTime = System.currentTimeMillis();
// Path: src/test/java/model/AuthResult.java // public class AuthResult { // public String address; // public String secret; // // public AuthResult(String address, String secret) { // this.address = address; // this.secret = secret; // } // } // // Path: src/test/java/model/M...
MyWebSocketClient ch = new MyWebSocketClient(uri, new Draft_17());
bupt1987/JgWeb
src/test/java/client/TestMaxUser.java
// Path: src/test/java/model/AuthResult.java // public class AuthResult { // public String address; // public String secret; // // public AuthResult(String address, String secret) { // this.address = address; // this.secret = secret; // } // } // // Path: src/test/java/model/M...
import com.zhaidaosi.game.jgframework.message.InMessage; import com.zhaidaosi.game.jgframework.session.SessionManager; import model.AuthResult; import model.MyWebSocketClient; import org.java_websocket.drafts.Draft_17; import java.net.URI;
long endTime = System.currentTimeMillis(); System.out.println("end time : " + endTime + " | run time :" + (endTime - startTime)); } public static void main(String[] args) throws Exception { long startTime = System.currentTimeMillis(); System.out.println(startTime); for (...
// Path: src/test/java/model/AuthResult.java // public class AuthResult { // public String address; // public String secret; // // public AuthResult(String address, String secret) { // this.address = address; // this.secret = secret; // } // } // // Path: src/test/java/model/M...
AuthResult ar = TestAuth.auth(username, password);
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/handler/SendMsgHandler.java
// Path: src/main/java/com/zhaidaosi/game/server/model/player/Player.java // public class Player extends BasePlayer { // // private static Map<Integer, Integer> levelExperience = new HashMap<>(); // // private UserInfo userInfo; // private BasePosition oldPosition; // private Map<String, Integer> acti...
import java.util.HashMap; import java.util.Map; import com.zhaidaosi.game.jgframework.connector.IBaseConnector; import com.zhaidaosi.game.jgframework.handler.BaseHandler; import com.zhaidaosi.game.jgframework.message.IBaseMessage; import com.zhaidaosi.game.jgframework.message.InMessage; import com.zhaidaosi.game....
package com.zhaidaosi.game.server.handler; public class SendMsgHandler extends BaseHandler { @Override public IBaseMessage run(InMessage im, Channel ch) { Object msg = im.getMember("msg"); if (msg == null || msg.equals("")) { return OutMessage.showError("msg 不能为空"); ...
// Path: src/main/java/com/zhaidaosi/game/server/model/player/Player.java // public class Player extends BasePlayer { // // private static Map<Integer, Integer> levelExperience = new HashMap<>(); // // private UserInfo userInfo; // private BasePosition oldPosition; // private Map<String, Integer> acti...
Player player = (Player) ch.attr(IBaseConnector.PLAYER).get();
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/handler/auth/LoginHandler.java
// Path: src/main/java/com/zhaidaosi/game/server/rsync/UserRsync.java // public class UserRsync extends BaseRsync { // // private static final Logger log = LoggerFactory.getLogger(UserRsync.class); // // @Override // public void runRsync() { // UserService service = (UserService) ServiceMana...
import java.util.HashMap; import com.zhaidaosi.game.jgframework.Boot; import com.zhaidaosi.game.jgframework.common.BaseString; import com.zhaidaosi.game.jgframework.common.encrpt.BaseMd5; import com.zhaidaosi.game.jgframework.common.spring.ServiceManager; import com.zhaidaosi.game.jgframework.connector.AuthConnector; i...
package com.zhaidaosi.game.server.handler.auth; public class LoginHandler extends BaseHandler { UserService userService = (UserService) ServiceManager.getService(UserService.BEAN_ID); @Override public IBaseMessage run(InMessage im, Channel ch) throws Exception { HashMap<String, Object> args = ...
// Path: src/main/java/com/zhaidaosi/game/server/rsync/UserRsync.java // public class UserRsync extends BaseRsync { // // private static final Logger log = LoggerFactory.getLogger(UserRsync.class); // // @Override // public void runRsync() { // UserService service = (UserService) ServiceMana...
User user = userService.findByUserName(username);
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/sdm/service/UserInfoService.java
// Path: src/main/java/com/zhaidaosi/game/server/model/action/AttackAction.java // public class AttackAction extends BaseAction { // // public static int ID = 1; // // private int level = 1; // // private int minDamage; // // private int maxDamage; // // public AttackAction() { // ...
import java.util.HashMap; import java.util.Map; import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import com.zhaidaosi.game.jgframework.common.BaseJson; import com.zhaidaosi.game.jgframework.common.sdm.BaseService; import com.zhaidaosi.game.jgframework.common.sdm.IBas...
package com.zhaidaosi.game.server.sdm.service; public class UserInfoService extends BaseService { public final static String BEAN_ID = "userInfoService"; @Autowired
// Path: src/main/java/com/zhaidaosi/game/server/model/action/AttackAction.java // public class AttackAction extends BaseAction { // // public static int ID = 1; // // private int level = 1; // // private int minDamage; // // private int maxDamage; // // public AttackAction() { // ...
protected UserInfoDAO dao;
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/sdm/service/UserInfoService.java
// Path: src/main/java/com/zhaidaosi/game/server/model/action/AttackAction.java // public class AttackAction extends BaseAction { // // public static int ID = 1; // // private int level = 1; // // private int minDamage; // // private int maxDamage; // // public AttackAction() { // ...
import java.util.HashMap; import java.util.Map; import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import com.zhaidaosi.game.jgframework.common.BaseJson; import com.zhaidaosi.game.jgframework.common.sdm.BaseService; import com.zhaidaosi.game.jgframework.common.sdm.IBas...
package com.zhaidaosi.game.server.sdm.service; public class UserInfoService extends BaseService { public final static String BEAN_ID = "userInfoService"; @Autowired protected UserInfoDAO dao; @PostConstruct protected void setDao() { super.setDao(dao); } public IBaseModel fin...
// Path: src/main/java/com/zhaidaosi/game/server/model/action/AttackAction.java // public class AttackAction extends BaseAction { // // public static int ID = 1; // // private int level = 1; // // private int minDamage; // // private int maxDamage; // // public AttackAction() { // ...
IBaseModel model = RsyncManager.get(uid, UserInfoRsync.class);
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/sdm/service/UserInfoService.java
// Path: src/main/java/com/zhaidaosi/game/server/model/action/AttackAction.java // public class AttackAction extends BaseAction { // // public static int ID = 1; // // private int level = 1; // // private int minDamage; // // private int maxDamage; // // public AttackAction() { // ...
import java.util.HashMap; import java.util.Map; import javax.annotation.PostConstruct; import org.springframework.beans.factory.annotation.Autowired; import com.zhaidaosi.game.jgframework.common.BaseJson; import com.zhaidaosi.game.jgframework.common.sdm.BaseService; import com.zhaidaosi.game.jgframework.common.sdm.IBas...
package com.zhaidaosi.game.server.sdm.service; public class UserInfoService extends BaseService { public final static String BEAN_ID = "userInfoService"; @Autowired protected UserInfoDAO dao; @PostConstruct protected void setDao() { super.setDao(dao); } public IBaseModel fin...
// Path: src/main/java/com/zhaidaosi/game/server/model/action/AttackAction.java // public class AttackAction extends BaseAction { // // public static int ID = 1; // // private int level = 1; // // private int minDamage; // // private int maxDamage; // // public AttackAction() { // ...
actions.put(Integer.toString(AttackAction.ID), 1);
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/rsync/UserInfoRsync.java
// Path: src/main/java/com/zhaidaosi/game/server/sdm/model/UserInfo.java // @SuppressWarnings("serial") // @Entity // @Table(name = "user_info", catalog = "jgframework", uniqueConstraints = @UniqueConstraint(columnNames = "uid")) // public class UserInfo extends BaseModel { // // // Fields // // private Integ...
import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.zhaidaosi.game.jgframework.common.sdm.IBaseModel; import com.zhaidaosi.game.jgframework.common.spring.ServiceManager; import com.zhaidaosi.game.jgframework.rsync.BaseRsync; import com.zhaidaosi.game.server.sdm.model.UserInfo...
package com.zhaidaosi.game.server.rsync; public class UserInfoRsync extends BaseRsync { private static final Logger log = LoggerFactory.getLogger(UserInfoRsync.class); @Override public void runRsync() {
// Path: src/main/java/com/zhaidaosi/game/server/sdm/model/UserInfo.java // @SuppressWarnings("serial") // @Entity // @Table(name = "user_info", catalog = "jgframework", uniqueConstraints = @UniqueConstraint(columnNames = "uid")) // public class UserInfo extends BaseModel { // // // Fields // // private Integ...
UserInfoService service = (UserInfoService) ServiceManager.getService(UserInfoService.BEAN_ID);
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/rsync/UserInfoRsync.java
// Path: src/main/java/com/zhaidaosi/game/server/sdm/model/UserInfo.java // @SuppressWarnings("serial") // @Entity // @Table(name = "user_info", catalog = "jgframework", uniqueConstraints = @UniqueConstraint(columnNames = "uid")) // public class UserInfo extends BaseModel { // // // Fields // // private Integ...
import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.zhaidaosi.game.jgframework.common.sdm.IBaseModel; import com.zhaidaosi.game.jgframework.common.spring.ServiceManager; import com.zhaidaosi.game.jgframework.rsync.BaseRsync; import com.zhaidaosi.game.server.sdm.model.UserInfo...
package com.zhaidaosi.game.server.rsync; public class UserInfoRsync extends BaseRsync { private static final Logger log = LoggerFactory.getLogger(UserInfoRsync.class); @Override public void runRsync() { UserInfoService service = (UserInfoService) ServiceManager.getService(UserInfoSe...
// Path: src/main/java/com/zhaidaosi/game/server/sdm/model/UserInfo.java // @SuppressWarnings("serial") // @Entity // @Table(name = "user_info", catalog = "jgframework", uniqueConstraints = @UniqueConstraint(columnNames = "uid")) // public class UserInfo extends BaseModel { // // // Fields // // private Integ...
UserInfo userInfo = (UserInfo) entry.getValue();
bupt1987/JgWeb
src/main/java/com/zhaidaosi/game/server/model/action/AttackAction.java
// Path: src/main/java/com/zhaidaosi/game/server/model/Duel.java // public class Duel { // // public static final String END = "end"; // public static final String INIT = "init"; // public static final String MSG = "msg"; // // public static Player doDuel(Player me, Player target, DuelZone zone, Strin...
import com.zhaidaosi.game.jgframework.handler.BaseHandlerChannel; import com.zhaidaosi.game.jgframework.model.action.BaseAction; import com.zhaidaosi.game.server.model.Duel; import com.zhaidaosi.game.server.model.player.Player;
package com.zhaidaosi.game.server.model.action; public class AttackAction extends BaseAction { public static int ID = 1; private int level = 1; private int minDamage; private int maxDamage; public AttackAction() { super(ID, "基本攻击"); } @Override public vo...
// Path: src/main/java/com/zhaidaosi/game/server/model/Duel.java // public class Duel { // // public static final String END = "end"; // public static final String INIT = "init"; // public static final String MSG = "msg"; // // public static Player doDuel(Player me, Player target, DuelZone zone, Strin...
Player selfPlayer = (Player) self;
bupt1987/JgWeb
src/test/java/client/TestJson.java
// Path: src/main/java/com/zhaidaosi/game/server/sdm/model/User.java // @SuppressWarnings("serial") // @Entity // @Table(name = "user", catalog = "jgframework") // public class User extends BaseModel { // // // Fields // // private Integer id; // private String username; // private String password; //...
import com.zhaidaosi.game.server.sdm.model.User;
package client; public class TestJson { public static void main(String[] args) {
// Path: src/main/java/com/zhaidaosi/game/server/sdm/model/User.java // @SuppressWarnings("serial") // @Entity // @Table(name = "user", catalog = "jgframework") // public class User extends BaseModel { // // // Fields // // private Integer id; // private String username; // private String password; //...
User user = new User("test", "123456", 1L, 1L);
jaksab/EasyNetwork
easynet/src/main/java/pro/oncreate/easynet/methods/Method.java
// Path: easynet/src/main/java/pro/oncreate/easynet/data/NConst.java // @SuppressWarnings("unused,WeakerAccess") // public class NConst { // // // // // // // // // public static final String POST = "POST"; // public static final String GET = "GET"; // public static final String PUT = "PUT"; /...
import android.support.annotation.NonNull; import pro.oncreate.easynet.data.NConst;
package pro.oncreate.easynet.methods; /** * Created by Andrii Konovalenko, 2014-2017 years. * Copyright © 2017 [Andrii Konovalenko]. All Rights Reserved. */ @SuppressWarnings("unused,WeakerAccess") public abstract class Method { public abstract String name(); public abstract boolean withBody(); pu...
// Path: easynet/src/main/java/pro/oncreate/easynet/data/NConst.java // @SuppressWarnings("unused,WeakerAccess") // public class NConst { // // // // // // // // // public static final String POST = "POST"; // public static final String GET = "GET"; // public static final String PUT = "PUT"; /...
case NConst.GET:
jaksab/EasyNetwork
easynet/src/main/java/pro/oncreate/easynet/utils/NDataBuilder.java
// Path: easynet/src/main/java/pro/oncreate/easynet/models/subsidiary/NKeyValueModel.java // @SuppressWarnings("unused,WeakerAccess") // public class NKeyValueModel extends NKeyModel { // // private String value; // // public NKeyValueModel(String key, String value) { // super(key); // this.va...
import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.List; import pro.oncreate.easynet.models.subsidiary.NKeyValueModel;
package pro.oncreate.easynet.utils; /** * Copyright (c) $today.year. Konovalenko Andrii [jaksab2@mail.ru] */ @SuppressWarnings("unused,WeakerAccess") public class NDataBuilder {
// Path: easynet/src/main/java/pro/oncreate/easynet/models/subsidiary/NKeyValueModel.java // @SuppressWarnings("unused,WeakerAccess") // public class NKeyValueModel extends NKeyModel { // // private String value; // // public NKeyValueModel(String key, String value) { // super(key); // this.va...
public static String getQuery(List<NKeyValueModel> params, String charset) throws UnsupportedEncodingException {
jaksab/EasyNetwork
app/src/main/java/pro/oncreate/easynetwork/models/CountryModel.java
// Path: easynet/src/main/java/pro/oncreate/easynet/models/NBaseModel.java // @SuppressWarnings("unused,WeakerAccess") // public abstract class NBaseModel { // // public abstract NBaseModel parse(NResponseModel responseModel, JSONObject jsonObject); // } // // Path: easynet/src/main/java/pro/oncreate/easynet/mode...
import org.json.JSONObject; import pro.oncreate.easynet.models.NBaseModel; import pro.oncreate.easynet.models.NResponseModel;
this.id = id; this.code = code; this.name = name; } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getCode() { return code; } public void setCode(String code) { this.code = code; ...
// Path: easynet/src/main/java/pro/oncreate/easynet/models/NBaseModel.java // @SuppressWarnings("unused,WeakerAccess") // public abstract class NBaseModel { // // public abstract NBaseModel parse(NResponseModel responseModel, JSONObject jsonObject); // } // // Path: easynet/src/main/java/pro/oncreate/easynet/mode...
public CountryModel parse(NResponseModel responseModel, JSONObject jsonObject) {
jaksab/EasyNetwork
easynet/src/main/java/pro/oncreate/easynet/utils/NHelper.java
// Path: easynet/src/main/java/pro/oncreate/easynet/models/NResponseModel.java // @SuppressWarnings("unused,WeakerAccess") // public class NResponseModel { // // public static final int STATUS_TYPE_SUCCESS = 1, STATUS_TYPE_ERROR = 2; // // private String url; // private int statusCode; // private Stri...
import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkInfo; import java.util.List; import pro.oncreate.easynet.models.NResponseModel;
package pro.oncreate.easynet.utils; /** * Created by andrej on 17.11.15. */ @SuppressWarnings("unused,WeakerAccess") public class NHelper { static public boolean isActiveInternet(Context context) { try { ConnectivityManager cm = (ConnectivityManager) context .getSyst...
// Path: easynet/src/main/java/pro/oncreate/easynet/models/NResponseModel.java // @SuppressWarnings("unused,WeakerAccess") // public class NResponseModel { // // public static final int STATUS_TYPE_SUCCESS = 1, STATUS_TYPE_ERROR = 2; // // private String url; // private int statusCode; // private Stri...
static public String getFirstHeader(NResponseModel responseModel, String header) {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/dependencies/modules/ApplicationModule.java
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java // public class DereferenceApplication extends Application { // @Inject // MainInitialiser mainInitialiser; // // @Inject // FlavourInitialiser flavourInitialiser; // private ApplicationInjectionComponent component; //...
import javax.inject.Singleton; import android.content.Context; import com.pacoworks.dereference.DereferenceApplication; import com.pacoworks.dereference.FlavourInitialiser; import com.pacoworks.dereference.MainInitialiser; import com.squareup.okhttp.OkHttpClient; import dagger.Module; import dagger.Provides;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java // public class DereferenceApplication extends Application { // @Inject // MainInitialiser mainInitialiser; // // @Inject // FlavourInitialiser flavourInitialiser; // private ApplicationInjectionComponent component; //...
DereferenceApplication application;
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/dependencies/modules/ApplicationModule.java
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java // public class DereferenceApplication extends Application { // @Inject // MainInitialiser mainInitialiser; // // @Inject // FlavourInitialiser flavourInitialiser; // private ApplicationInjectionComponent component; //...
import javax.inject.Singleton; import android.content.Context; import com.pacoworks.dereference.DereferenceApplication; import com.pacoworks.dereference.FlavourInitialiser; import com.pacoworks.dereference.MainInitialiser; import com.squareup.okhttp.OkHttpClient; import dagger.Module; import dagger.Provides;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java // public class DereferenceApplication extends Application { // @Inject // MainInitialiser mainInitialiser; // // @Inject // FlavourInitialiser flavourInitialiser; // private ApplicationInjectionComponent component; //...
MainInitialiser provideMainInitialiser(DereferenceApplication application,
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/dependencies/modules/ApplicationModule.java
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java // public class DereferenceApplication extends Application { // @Inject // MainInitialiser mainInitialiser; // // @Inject // FlavourInitialiser flavourInitialiser; // private ApplicationInjectionComponent component; //...
import javax.inject.Singleton; import android.content.Context; import com.pacoworks.dereference.DereferenceApplication; import com.pacoworks.dereference.FlavourInitialiser; import com.pacoworks.dereference.MainInitialiser; import com.squareup.okhttp.OkHttpClient; import dagger.Module; import dagger.Provides;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java // public class DereferenceApplication extends Application { // @Inject // MainInitialiser mainInitialiser; // // @Inject // FlavourInitialiser flavourInitialiser; // private ApplicationInjectionComponent component; //...
FlavourInitialiser provideFlavourInitialiser(DereferenceApplication application) {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkickdetails/SongkickDetailsState.java
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimpleBaseState.java // public abstract class ZimpleBaseState implements Serializable { // } // // Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static f...
import java.util.ArrayList; import java.util.List; import lombok.Data; import lombok.EqualsAndHashCode; import com.pacoworks.dereference.dependencies.skeleton.ZimpleBaseState; import com.pacoworks.dereference.model.Artist;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimpleBaseState.java // public abstract class ZimpleBaseState implements Serializable { // } // // Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static f...
public class SongkickDetailsState extends ZimpleBaseState {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkickdetails/SongkickDetailsState.java
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimpleBaseState.java // public abstract class ZimpleBaseState implements Serializable { // } // // Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static f...
import java.util.ArrayList; import java.util.List; import lombok.Data; import lombok.EqualsAndHashCode; import com.pacoworks.dereference.dependencies.skeleton.ZimpleBaseState; import com.pacoworks.dereference.model.Artist;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimpleBaseState.java // public abstract class ZimpleBaseState implements Serializable { // } // // Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static f...
private List<Artist> cached;
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkicklist/ISongkickListUI.java
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/IUi.java // public interface IUi { // Action1<? super Boolean> showOfflineOverlay(); // // Action1<Throwable> toastError(); // // Action1<String> toastMessage(); // } // // Path: app/src/main/java/com/pacoworks/dereference/model/A...
import java.util.List; import rx.Observable; import rx.functions.Action1; import com.pacoworks.dereference.dependencies.skeleton.IUi; import com.pacoworks.dereference.model.Artist;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/IUi.java // public interface IUi { // Action1<? super Boolean> showOfflineOverlay(); // // Action1<Throwable> toastError(); // // Action1<String> toastMessage(); // } // // Path: app/src/main/java/com/pacoworks/dereference/model/A...
Observable<Artist> getArtistClicks();
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkicklist/SongkickListInjectionComponent.java
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
import com.pacoworks.dereference.ApplicationInjectionComponent; import com.pacoworks.dereference.dependencies.ActivityInjectionComponent; import com.pacoworks.dereference.dependencies.ForActivity; import com.pacoworks.dereference.dependencies.modules.ActivityModule; import dagger.Component;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
ActivityModule.class, SongkickListModule.class
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkicklist/SongkickListInjectionComponent.java
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
import com.pacoworks.dereference.ApplicationInjectionComponent; import com.pacoworks.dereference.dependencies.ActivityInjectionComponent; import com.pacoworks.dereference.dependencies.ForActivity; import com.pacoworks.dereference.dependencies.modules.ActivityModule; import dagger.Component;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
ActivityInjectionComponent<SongkickListPresenter> {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkicklist/SongkickListState.java
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimpleBaseState.java // public abstract class ZimpleBaseState implements Serializable { // } // // Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static f...
import java.util.ArrayList; import java.util.List; import lombok.Data; import lombok.EqualsAndHashCode; import com.pacoworks.dereference.dependencies.skeleton.ZimpleBaseState; import com.pacoworks.dereference.model.Artist;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimpleBaseState.java // public abstract class ZimpleBaseState implements Serializable { // } // // Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static f...
public class SongkickListState extends ZimpleBaseState {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkicklist/SongkickListState.java
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimpleBaseState.java // public abstract class ZimpleBaseState implements Serializable { // } // // Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static f...
import java.util.ArrayList; import java.util.List; import lombok.Data; import lombok.EqualsAndHashCode; import com.pacoworks.dereference.dependencies.skeleton.ZimpleBaseState; import com.pacoworks.dereference.model.Artist;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimpleBaseState.java // public abstract class ZimpleBaseState implements Serializable { // } // // Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static f...
private List<Artist> cached = new ArrayList<>();
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/ui/delegates/RelatedArtistDelegate.java
// Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static final long serialVersionUID = 4653212L; // // @SerializedName("displayName") // private final String displayName; // // @SerializedName("id") // private fi...
import java.util.List; import android.support.annotation.NonNull; import com.pacoworks.dereference.model.Artist;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static final long serialVersionUID = 4653212L; // // @SerializedName("displayName") // private final String displayName; // // @SerializedName("id") // private fi...
public boolean isForViewType(@NonNull List<Artist> items, int position) {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkicklist/SongkickListModule.java
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimplBasePresenter.java // public abstract class ZimplBasePresenter<T extends IUi, U extends ZimpleBaseState> { // private final Class<U> stateClass; // // private final List<Subscription> pauseSubscriptions = new ArrayList<>(); // // ...
import com.pacoworks.dereference.dependencies.skeleton.ZimplBasePresenter; import dagger.Module; import dagger.Provides;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimplBasePresenter.java // public abstract class ZimplBasePresenter<T extends IUi, U extends ZimpleBaseState> { // private final Class<U> stateClass; // // private final List<Subscription> pauseSubscriptions = new ArrayList<>(); // // ...
ZimplBasePresenter providePresenter() {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/dependencies/DependencyDescription.java
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java // public class DereferenceApplication extends Application { // @Inject // MainInitialiser mainInitialiser; // // @Inject // FlavourInitialiser flavourInitialiser; // private ApplicationInjectionComponent component; //...
import com.squareup.picasso.OkHttpDownloader; import javax.inject.Named; import retrofit.Retrofit; import android.content.Context; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; import com.pacoworks.dereference.DereferenceApplication; import com.pacoworks.dereference.FlavourInitialiser...
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java // public class DereferenceApplication extends Application { // @Inject // MainInitialiser mainInitialiser; // // @Inject // FlavourInitialiser flavourInitialiser; // private ApplicationInjectionComponent component; //...
MainInitialiser initialiser();
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/dependencies/DependencyDescription.java
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java // public class DereferenceApplication extends Application { // @Inject // MainInitialiser mainInitialiser; // // @Inject // FlavourInitialiser flavourInitialiser; // private ApplicationInjectionComponent component; //...
import com.squareup.picasso.OkHttpDownloader; import javax.inject.Named; import retrofit.Retrofit; import android.content.Context; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; import com.pacoworks.dereference.DereferenceApplication; import com.pacoworks.dereference.FlavourInitialiser...
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java // public class DereferenceApplication extends Application { // @Inject // MainInitialiser mainInitialiser; // // @Inject // FlavourInitialiser flavourInitialiser; // private ApplicationInjectionComponent component; //...
FlavourInitialiser flavourInitialiser();
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/dependencies/DependencyDescription.java
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java // public class DereferenceApplication extends Application { // @Inject // MainInitialiser mainInitialiser; // // @Inject // FlavourInitialiser flavourInitialiser; // private ApplicationInjectionComponent component; //...
import com.squareup.picasso.OkHttpDownloader; import javax.inject.Named; import retrofit.Retrofit; import android.content.Context; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; import com.pacoworks.dereference.DereferenceApplication; import com.pacoworks.dereference.FlavourInitialiser...
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/DereferenceApplication.java // public class DereferenceApplication extends Application { // @Inject // MainInitialiser mainInitialiser; // // @Inject // FlavourInitialiser flavourInitialiser; // private ApplicationInjectionComponent component; //...
SongkickApi songkickApi();
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/dependencies/modules/NetworkModule.java
// Path: app/src/main/java/com/pacoworks/dereference/network/LoggerInterceptor.java // public class LoggerInterceptor implements Interceptor { // @Override // public Response intercept(Chain chain) throws IOException { // Timber.d("Started request ==> %s", chain.request().url().toString()); // r...
import com.pacoworks.dereference.network.SongkickApi; import com.squareup.okhttp.Cache; import com.squareup.okhttp.OkHttpClient; import com.squareup.picasso.OkHttpDownloader; import dagger.Module; import dagger.Provides; import java.io.File; import java.util.concurrent.TimeUnit; import javax.inject.Named; import javax....
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/network/LoggerInterceptor.java // public class LoggerInterceptor implements Interceptor { // @Override // public Response intercept(Chain chain) throws IOException { // Timber.d("Started request ==> %s", chain.request().url().toString()); // r...
OkHttpClient provideOkHttp(final Cache cache, LoggerInterceptor loggerInterceptor,
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/dependencies/modules/NetworkModule.java
// Path: app/src/main/java/com/pacoworks/dereference/network/LoggerInterceptor.java // public class LoggerInterceptor implements Interceptor { // @Override // public Response intercept(Chain chain) throws IOException { // Timber.d("Started request ==> %s", chain.request().url().toString()); // r...
import com.pacoworks.dereference.network.SongkickApi; import com.squareup.okhttp.Cache; import com.squareup.okhttp.OkHttpClient; import com.squareup.picasso.OkHttpDownloader; import dagger.Module; import dagger.Provides; import java.io.File; import java.util.concurrent.TimeUnit; import javax.inject.Named; import javax....
@Provides @Singleton Cache provideCache() { return new Cache(cacheDir, cacheSize); } @Provides @Singleton StethoInterceptor stethoInterceptor() { return new StethoInterceptor(); } @Provides @Singleton LoggerInterceptor loggerInterceptor() { return n...
// Path: app/src/main/java/com/pacoworks/dereference/network/LoggerInterceptor.java // public class LoggerInterceptor implements Interceptor { // @Override // public Response intercept(Chain chain) throws IOException { // Timber.d("Started request ==> %s", chain.request().url().toString()); // r...
SongkickApi provideSongkickApi(@Named("songkick") Retrofit retrofit) {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkickdetails/SongkickDetailsModule.java
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimplBasePresenter.java // public abstract class ZimplBasePresenter<T extends IUi, U extends ZimpleBaseState> { // private final Class<U> stateClass; // // private final List<Subscription> pauseSubscriptions = new ArrayList<>(); // // ...
import com.pacoworks.dereference.dependencies.skeleton.ZimplBasePresenter; import dagger.Module; import dagger.Provides;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimplBasePresenter.java // public abstract class ZimplBasePresenter<T extends IUi, U extends ZimpleBaseState> { // private final Class<U> stateClass; // // private final List<Subscription> pauseSubscriptions = new ArrayList<>(); // // ...
ZimplBasePresenter providePresenter() {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkickdetails/ISongkickDetailsUI.java
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/IUi.java // public interface IUi { // Action1<? super Boolean> showOfflineOverlay(); // // Action1<Throwable> toastError(); // // Action1<String> toastMessage(); // } // // Path: app/src/main/java/com/pacoworks/dereference/model/A...
import java.util.List; import rx.Observable; import rx.functions.Action1; import com.pacoworks.dereference.dependencies.skeleton.IUi; import com.pacoworks.dereference.model.Artist;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/IUi.java // public interface IUi { // Action1<? super Boolean> showOfflineOverlay(); // // Action1<Throwable> toastError(); // // Action1<String> toastMessage(); // } // // Path: app/src/main/java/com/pacoworks/dereference/model/A...
Action1<List<Artist>> swapAdapter();
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkickdetails/SongkickDetailsInjectionComponent.java
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
import com.pacoworks.dereference.ApplicationInjectionComponent; import com.pacoworks.dereference.dependencies.ActivityInjectionComponent; import com.pacoworks.dereference.dependencies.ForActivity; import com.pacoworks.dereference.dependencies.modules.ActivityModule; import dagger.Component;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
ActivityModule.class, SongkickDetailsModule.class
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/screens/songkickdetails/SongkickDetailsInjectionComponent.java
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
import com.pacoworks.dereference.ApplicationInjectionComponent; import com.pacoworks.dereference.dependencies.ActivityInjectionComponent; import com.pacoworks.dereference.dependencies.ForActivity; import com.pacoworks.dereference.dependencies.modules.ActivityModule; import dagger.Component;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
ActivityInjectionComponent<SongkickDetailsPresenter> {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/ui/adapters/ArtistListAdapter.java
// Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static final long serialVersionUID = 4653212L; // // @SerializedName("displayName") // private final String displayName; // // @SerializedName("id") // private fi...
import java.util.ArrayList; import java.util.List; import rx.Observable; import rx.functions.Action1; import android.support.v7.widget.RecyclerView; import android.view.ViewGroup; import com.hannesdorfmann.adapterdelegates.AdapterDelegatesManager; import com.pacoworks.dereference.model.Artist; import com.pacoworks.dere...
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static final long serialVersionUID = 4653212L; // // @SerializedName("displayName") // private final String displayName; // // @SerializedName("id") // private fi...
private final ArtistDelegate artistDelegate;
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/ui/adapters/ArtistListAdapter.java
// Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static final long serialVersionUID = 4653212L; // // @SerializedName("displayName") // private final String displayName; // // @SerializedName("id") // private fi...
import java.util.ArrayList; import java.util.List; import rx.Observable; import rx.functions.Action1; import android.support.v7.widget.RecyclerView; import android.view.ViewGroup; import com.hannesdorfmann.adapterdelegates.AdapterDelegatesManager; import com.pacoworks.dereference.model.Artist; import com.pacoworks.dere...
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/model/Artist.java // @ToString // public class Artist implements Serializable { // static final long serialVersionUID = 4653212L; // // @SerializedName("displayName") // private final String displayName; // // @SerializedName("id") // private fi...
delegatesManager.addDelegate(new EmptyDelegate<Artist>());
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimplBaseActivity.java
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
import javax.inject.Inject; import lombok.AccessLevel; import lombok.Getter; import rx.functions.Action1; import android.app.Activity; import android.os.Bundle; import android.support.annotation.NonNull; import android.text.TextUtils; import android.widget.Toast; import butterknife.ButterKnife; import com.pacoworks.der...
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
private ActivityInjectionComponent injector;
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimplBaseActivity.java
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
import javax.inject.Inject; import lombok.AccessLevel; import lombok.Getter; import rx.functions.Action1; import android.app.Activity; import android.os.Bundle; import android.support.annotation.NonNull; import android.text.TextUtils; import android.widget.Toast; import butterknife.ButterKnife; import com.pacoworks.der...
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
final ApplicationInjectionComponent applicationInjectionComponent = DereferenceApplication
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/dependencies/skeleton/ZimplBaseActivity.java
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
import javax.inject.Inject; import lombok.AccessLevel; import lombok.Getter; import rx.functions.Action1; import android.app.Activity; import android.os.Bundle; import android.support.annotation.NonNull; import android.text.TextUtils; import android.widget.Toast; import butterknife.ButterKnife; import com.pacoworks.der...
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/whatever/java/com/pacoworks/dereference/ApplicationInjectionComponent.java // @Singleton // @Component(modules = { // ApplicationModule.class, SerializationModule.class, NetworkModule.class // }) // public interface ApplicationInjectionComponent extends DependencyDescription { // final clas...
final ApplicationInjectionComponent applicationInjectionComponent = DereferenceApplication
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/reactive/RxTuples.java
// Path: app/src/main/java/com/pacoworks/dereference/reactive/tuples/Quadriple.java // @EqualsAndHashCode // @ToString // public class Quadriple<T, U, V, X> implements Serializable { // public final T first; // // public final U second; // // public final V third; // // public final X fourth; // // ...
import lombok.experimental.UtilityClass; import rx.functions.Func2; import com.pacoworks.dereference.reactive.tuples.Quadriple; import com.pacoworks.dereference.reactive.tuples.Triple; import com.pacoworks.dereference.reactive.tuples.Tuple;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/reactive/tuples/Quadriple.java // @EqualsAndHashCode // @ToString // public class Quadriple<T, U, V, X> implements Serializable { // public final T first; // // public final U second; // // public final V third; // // public final X fourth; // // ...
public static <T, U> Func2<T, U, Tuple<T, U>> singleToTuple() {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/reactive/RxTuples.java
// Path: app/src/main/java/com/pacoworks/dereference/reactive/tuples/Quadriple.java // @EqualsAndHashCode // @ToString // public class Quadriple<T, U, V, X> implements Serializable { // public final T first; // // public final U second; // // public final V third; // // public final X fourth; // // ...
import lombok.experimental.UtilityClass; import rx.functions.Func2; import com.pacoworks.dereference.reactive.tuples.Quadriple; import com.pacoworks.dereference.reactive.tuples.Triple; import com.pacoworks.dereference.reactive.tuples.Tuple;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/reactive/tuples/Quadriple.java // @EqualsAndHashCode // @ToString // public class Quadriple<T, U, V, X> implements Serializable { // public final T first; // // public final U second; // // public final V third; // // public final X fourth; // // ...
public static <T, U, V> Func2<T, Tuple<U, V>, Triple<T, U, V>> singleToTriple() {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/reactive/RxTuples.java
// Path: app/src/main/java/com/pacoworks/dereference/reactive/tuples/Quadriple.java // @EqualsAndHashCode // @ToString // public class Quadriple<T, U, V, X> implements Serializable { // public final T first; // // public final U second; // // public final V third; // // public final X fourth; // // ...
import lombok.experimental.UtilityClass; import rx.functions.Func2; import com.pacoworks.dereference.reactive.tuples.Quadriple; import com.pacoworks.dereference.reactive.tuples.Triple; import com.pacoworks.dereference.reactive.tuples.Tuple;
}; } public static <T, U> Func2<T, U, Tuple<U, T>> singleToTupleInverse() { return new Func2<T, U, Tuple<U, T>>() { @Override public Tuple<U, T> call(T first, U second) { return new Tuple<>(second, first); } }; } public static...
// Path: app/src/main/java/com/pacoworks/dereference/reactive/tuples/Quadriple.java // @EqualsAndHashCode // @ToString // public class Quadriple<T, U, V, X> implements Serializable { // public final T first; // // public final U second; // // public final V third; // // public final X fourth; // // ...
public static <T, U, V, X> Func2<T, Triple<U, V, X>, Quadriple<T, U, V, X>> singleToQuadruple() {
pakoito/SongkickInterview
app/src/main/java/com/pacoworks/dereference/network/SongkickApi.java
// Path: app/src/main/java/com/pacoworks/dereference/model/SearchResult.java // @ToString // public class SearchResult { // @SerializedName("resultsPage") // private final ResultsPage resultsPage; // // public SearchResult(ResultsPage resultsPage) { // this.resultsPage = resultsPage; // } // /...
import retrofit.http.GET; import retrofit.http.Path; import retrofit.http.Query; import rx.Observable; import com.pacoworks.dereference.model.SearchResult;
/* * Copyright (c) pakoito 2015 * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distribute...
// Path: app/src/main/java/com/pacoworks/dereference/model/SearchResult.java // @ToString // public class SearchResult { // @SerializedName("resultsPage") // private final ResultsPage resultsPage; // // public SearchResult(ResultsPage resultsPage) { // this.resultsPage = resultsPage; // } // /...
Observable<SearchResult> getSearchResult(@Query("apikey") String apikey,
philliphsu/ClockPlus
app/src/main/java/com/philliphsu/clock2/dialogs/RingtonePickerDialog.java
// Path: app/src/main/java/com/philliphsu/clock2/ringtone/playback/RingtoneLoop.java // public final class RingtoneLoop { // // private final Context mContext; // private final AudioManager mAudioManager; // private final Uri mUri; // // private MediaPlayer mMediaPlayer; // // public RingtoneLoop...
import android.content.DialogInterface; import android.database.Cursor; import android.media.RingtoneManager; import android.net.Uri; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.app.AlertDialog; import com.philliphsu.clock2.R; import com.philliphsu.clock2.ringtone.pla...
/* * Copyright 2017 Phillip Hsu * * This file is part of ClockPlus. * * ClockPlus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
// Path: app/src/main/java/com/philliphsu/clock2/ringtone/playback/RingtoneLoop.java // public final class RingtoneLoop { // // private final Context mContext; // private final AudioManager mAudioManager; // private final Uri mUri; // // private MediaPlayer mMediaPlayer; // // public RingtoneLoop...
private RingtoneLoop mRingtone;
philliphsu/ClockPlus
app/src/main/java/com/philliphsu/clock2/timers/TimerController.java
// Path: app/src/main/java/com/philliphsu/clock2/timers/data/AsyncTimersTableUpdateHandler.java // public final class AsyncTimersTableUpdateHandler extends AsyncDatabaseTableUpdateHandler<Timer, TimersTableManager> { // private static final String TAG = "TimersTableUpdater"; // TAG max 23 chars // // public As...
import android.util.Log; import com.philliphsu.clock2.timers.data.AsyncTimersTableUpdateHandler;
/* * Copyright 2017 Phillip Hsu * * This file is part of ClockPlus. * * ClockPlus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
// Path: app/src/main/java/com/philliphsu/clock2/timers/data/AsyncTimersTableUpdateHandler.java // public final class AsyncTimersTableUpdateHandler extends AsyncDatabaseTableUpdateHandler<Timer, TimersTableManager> { // private static final String TAG = "TimersTableUpdater"; // TAG max 23 chars // // public As...
private final AsyncTimersTableUpdateHandler mUpdateHandler;
philliphsu/ClockPlus
app/src/main/java/com/philliphsu/clock2/settings/ThemedRingtonePreference.java
// Path: app/src/main/java/com/philliphsu/clock2/dialogs/RingtonePickerDialog.java // public class RingtonePickerDialog extends BaseAlertDialogFragment { // private static final String TAG = "RingtonePickerDialog"; // private static final String KEY_RINGTONE_URI = "key_ringtone_uri"; // // private Ringtone...
import com.philliphsu.clock2.dialogs.RingtonePickerDialog; import com.philliphsu.clock2.dialogs.RingtonePickerDialogController; import android.annotation.TargetApi; import android.content.Context; import android.content.Intent; import android.content.res.TypedArray; import android.net.Uri; import android.os.Parcelable;...
/* * Copyright 2017 Phillip Hsu * * This file is part of ClockPlus. * * ClockPlus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
// Path: app/src/main/java/com/philliphsu/clock2/dialogs/RingtonePickerDialog.java // public class RingtonePickerDialog extends BaseAlertDialogFragment { // private static final String TAG = "RingtonePickerDialog"; // private static final String KEY_RINGTONE_URI = "key_ringtone_uri"; // // private Ringtone...
private RingtonePickerDialogController mController;
philliphsu/ClockPlus
app/src/main/java/com/philliphsu/clock2/list/BaseCursorAdapter.java
// Path: app/src/main/java/com/philliphsu/clock2/data/BaseItemCursor.java // public abstract class BaseItemCursor<T extends ObjectWithId> extends CursorWrapper { // private static final String TAG = "BaseItemCursor"; // // public BaseItemCursor(Cursor cursor) { // super(cursor); // } // // /**...
import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.ViewGroup; import com.philliphsu.clock2.data.BaseItemCursor; import com.philliphsu.clock2.data.ObjectWithId;
/* * Copyright 2017 Phillip Hsu * * This file is part of ClockPlus. * * ClockPlus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
// Path: app/src/main/java/com/philliphsu/clock2/data/BaseItemCursor.java // public abstract class BaseItemCursor<T extends ObjectWithId> extends CursorWrapper { // private static final String TAG = "BaseItemCursor"; // // public BaseItemCursor(Cursor cursor) { // super(cursor); // } // // /**...
C extends BaseItemCursor<T>>
philliphsu/ClockPlus
app/src/main/java/com/philliphsu/clock2/dialogs/AddLabelDialog.java
// Path: app/src/main/java/com/philliphsu/clock2/util/KeyboardUtils.java // public static void showKeyboard(Context c, View v) { // InputMethodManager imm = (InputMethodManager) c.getSystemService(Context.INPUT_METHOD_SERVICE); // imm.showSoftInput(v, InputMethodManager.SHOW_IMPLICIT); // }
import android.content.DialogInterface; import android.support.v7.app.AlertDialog; import android.support.v7.widget.AppCompatEditText; import android.view.inputmethod.EditorInfo; import android.widget.EditText; import com.philliphsu.clock2.R; import static com.philliphsu.clock2.util.KeyboardUtils.showKeyboard;
/* * Copyright 2017 Phillip Hsu * * This file is part of ClockPlus. * * ClockPlus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
// Path: app/src/main/java/com/philliphsu/clock2/util/KeyboardUtils.java // public static void showKeyboard(Context c, View v) { // InputMethodManager imm = (InputMethodManager) c.getSystemService(Context.INPUT_METHOD_SERVICE); // imm.showSoftInput(v, InputMethodManager.SHOW_IMPLICIT); // } // Path: app/src/m...
showKeyboard(getActivity(), mEditText);
philliphsu/ClockPlus
app/src/main/java/com/philliphsu/clock2/data/AsyncDatabaseTableUpdateHandler.java
// Path: app/src/main/java/com/philliphsu/clock2/list/ScrollHandler.java // public interface ScrollHandler { // /** // * Specifies the stable id of the item we should scroll to in the list. // * This does not scroll the list. This is useful for preparing to scroll // * to the item when it does not ye...
import com.philliphsu.clock2.list.ScrollHandler; import android.content.Context; import android.os.AsyncTask;
/* * Copyright 2017 Phillip Hsu * * This file is part of ClockPlus. * * ClockPlus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
// Path: app/src/main/java/com/philliphsu/clock2/list/ScrollHandler.java // public interface ScrollHandler { // /** // * Specifies the stable id of the item we should scroll to in the list. // * This does not scroll the list. This is useful for preparing to scroll // * to the item when it does not ye...
private final ScrollHandler mScrollHandler;
philliphsu/ClockPlus
app/src/main/java/com/philliphsu/clock2/alarms/Alarm.java
// Path: app/src/main/java/com/philliphsu/clock2/data/ObjectWithId.java // public abstract class ObjectWithId { // private long id; // // public final long getId() { // return id; // } // // public final void setId(long id) { // this.id = id; // } // // public final int getInt...
import static com.philliphsu.clock2.alarms.misc.DaysOfWeek.NUM_DAYS; import static com.philliphsu.clock2.alarms.misc.DaysOfWeek.SATURDAY; import static com.philliphsu.clock2.alarms.misc.DaysOfWeek.SUNDAY; import android.os.Parcel; import android.os.Parcelable; import com.google.auto.value.AutoValue; import com.philliph...
/* * Copyright 2017 Phillip Hsu * * This file is part of ClockPlus. * * ClockPlus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
// Path: app/src/main/java/com/philliphsu/clock2/data/ObjectWithId.java // public abstract class ObjectWithId { // private long id; // // public final long getId() { // return id; // } // // public final void setId(long id) { // this.id = id; // } // // public final int getInt...
private final boolean[] recurringDays = new boolean[NUM_DAYS];
philliphsu/ClockPlus
app/src/main/java/com/philliphsu/clock2/alarms/Alarm.java
// Path: app/src/main/java/com/philliphsu/clock2/data/ObjectWithId.java // public abstract class ObjectWithId { // private long id; // // public final long getId() { // return id; // } // // public final void setId(long id) { // this.id = id; // } // // public final int getInt...
import static com.philliphsu.clock2.alarms.misc.DaysOfWeek.NUM_DAYS; import static com.philliphsu.clock2.alarms.misc.DaysOfWeek.SATURDAY; import static com.philliphsu.clock2.alarms.misc.DaysOfWeek.SUNDAY; import android.os.Parcel; import android.os.Parcelable; import com.google.auto.value.AutoValue; import com.philliph...
/* * Copyright 2017 Phillip Hsu * * This file is part of ClockPlus. * * ClockPlus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
// Path: app/src/main/java/com/philliphsu/clock2/data/ObjectWithId.java // public abstract class ObjectWithId { // private long id; // // public final long getId() { // return id; // } // // public final void setId(long id) { // this.id = id; // } // // public final int getInt...
for (int i = weekdayToday; i <= Calendar.SATURDAY; i++) {
philliphsu/ClockPlus
app/src/main/java/com/philliphsu/clock2/data/SQLiteCursorLoader.java
// Path: app/src/main/java/com/philliphsu/clock2/util/LocalBroadcastHelper.java // public final class LocalBroadcastHelper { // // /** Sends a local broadcast using an intent with the action specified */ // public static void sendBroadcast(Context context, String action) { // sendBroadcast(context, act...
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.support.v4.content.AsyncTaskLoader; import android.util.Log; import com.philliphsu.clock2.util.LocalBroadcastHelper;
/* * Copyright 2017 Phillip Hsu * * This file is part of ClockPlus. * * ClockPlus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
// Path: app/src/main/java/com/philliphsu/clock2/util/LocalBroadcastHelper.java // public final class LocalBroadcastHelper { // // /** Sends a local broadcast using an intent with the action specified */ // public static void sendBroadcast(Context context, String action) { // sendBroadcast(context, act...
LocalBroadcastHelper.registerReceiver(getContext(),
philliphsu/ClockPlus
app/src/main/java/com/philliphsu/clock2/data/DatabaseTableManager.java
// Path: app/src/main/java/com/philliphsu/clock2/util/LocalBroadcastHelper.java // public final class LocalBroadcastHelper { // // /** Sends a local broadcast using an intent with the action specified */ // public static void sendBroadcast(Context context, String action) { // sendBroadcast(context, act...
import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import com.philliphsu.clock2.util.LocalBroadcastHelper;
// positions as it binds VHs. c.moveToFirst(); return c; } public Cursor queryItems() { // Select all rows and columns return queryItems(null, null); } protected Cursor queryItems(String where, String limit) { return mDbHelper.getReadableDatabase().query...
// Path: app/src/main/java/com/philliphsu/clock2/util/LocalBroadcastHelper.java // public final class LocalBroadcastHelper { // // /** Sends a local broadcast using an intent with the action specified */ // public static void sendBroadcast(Context context, String action) { // sendBroadcast(context, act...
LocalBroadcastHelper.sendBroadcast(mAppContext, getOnContentChangeAction());
philliphsu/ClockPlus
app/src/main/java/com/philliphsu/clock2/list/RecyclerViewFragment.java
// Path: app/src/main/java/com/philliphsu/clock2/BaseFragment.java // public abstract class BaseFragment extends Fragment { // /** // * Required empty public constructor. Subclasses do not // * need to implement their own. // */ // public BaseFragment() {} // // /** // * @return the lay...
import android.widget.TextView; import com.philliphsu.clock2.BaseFragment; import com.philliphsu.clock2.R; import com.philliphsu.clock2.data.BaseItemCursor; import com.philliphsu.clock2.data.ObjectWithId; import butterknife.Bind; import android.os.Bundle; import android.support.annotation.DrawableRes; import android.su...
/* * Copyright 2017 Phillip Hsu * * This file is part of ClockPlus. * * ClockPlus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
// Path: app/src/main/java/com/philliphsu/clock2/BaseFragment.java // public abstract class BaseFragment extends Fragment { // /** // * Required empty public constructor. Subclasses do not // * need to implement their own. // */ // public BaseFragment() {} // // /** // * @return the lay...
C extends BaseItemCursor<T>,
philliphsu/ClockPlus
app/src/main/java/com/philliphsu/clock2/list/RecyclerViewFragment.java
// Path: app/src/main/java/com/philliphsu/clock2/BaseFragment.java // public abstract class BaseFragment extends Fragment { // /** // * Required empty public constructor. Subclasses do not // * need to implement their own. // */ // public BaseFragment() {} // // /** // * @return the lay...
import android.widget.TextView; import com.philliphsu.clock2.BaseFragment; import com.philliphsu.clock2.R; import com.philliphsu.clock2.data.BaseItemCursor; import com.philliphsu.clock2.data.ObjectWithId; import butterknife.Bind; import android.os.Bundle; import android.support.annotation.DrawableRes; import android.su...
/* * Copyright 2017 Phillip Hsu * * This file is part of ClockPlus. * * ClockPlus is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
// Path: app/src/main/java/com/philliphsu/clock2/BaseFragment.java // public abstract class BaseFragment extends Fragment { // /** // * Required empty public constructor. Subclasses do not // * need to implement their own. // */ // public BaseFragment() {} // // /** // * @return the lay...
extends BaseFragment implements
hosuaby/example-restful-project
src/main/java/io/hosuaby/restful/services/TeapotCommandService.java
// Path: src/main/java/io/hosuaby/restful/controllers/TeapotCommandController.java // @RestController // @RequestMapping("/actions/teapots") // public class TeapotCommandController { // // /** Teapot CRUD service */ // @Autowired // private TeapotCrudService crud; // // /** Teapot command service */ /...
import io.hosuaby.restful.controllers.TeapotCommandController; import io.hosuaby.restful.services.exceptions.teapots.TeapotNotConnectedException; import java.io.IOException; import javax.servlet.http.HttpServletRequest; import org.springframework.web.context.request.async.DeferredResult; import org.springframework.web....
package io.hosuaby.restful.services; /** * Service that provides registration of teapots and communication with them via * web socket sessions. */ public interface TeapotCommandService { /** * Registers a newly connected teapot with associated websocket connection. * * @param teapotId tea...
// Path: src/main/java/io/hosuaby/restful/controllers/TeapotCommandController.java // @RestController // @RequestMapping("/actions/teapots") // public class TeapotCommandController { // // /** Teapot CRUD service */ // @Autowired // private TeapotCrudService crud; // // /** Teapot command service */ /...
TeapotNotConnectedException;
hosuaby/example-restful-project
src/main/java/io/hosuaby/restful/services/exceptions/teapots/TeapotNotExistsException.java
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
import io.hosuaby.restful.domain.Teapot;
package io.hosuaby.restful.services.exceptions.teapots; /** * Exception thrown when asked teapot doesn't exist. */ public class TeapotNotExistsException extends Exception { /** * When teapot with defined id not exists. */ private static final String ERR_TEAPOT_WITH_ID_NOT_EXISTS = "Teapot with id...
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
public TeapotNotExistsException(Teapot teapot) {
hosuaby/example-restful-project
src/main/java/io/hosuaby/restful/domain/validators/TeapotValidator.java
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
import io.hosuaby.restful.domain.Teapot; import java.util.Arrays; import java.util.regex.Pattern; import org.springframework.stereotype.Component; import org.springframework.util.StringUtils; import org.springframework.validation.Errors; import org.springframework.validation.ValidationUtils; import org.springframework....
package io.hosuaby.restful.domain.validators; /** * Teapot validator. */ @Component public class TeapotValidator implements Validator { /** * Pattern for teapot id. Id must start with letter and can contain letter, * digits and "_" character. */ private static final Pattern ID_PATTERN = Pa...
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
Teapot.L0_3, Teapot.L0_5, Teapot.L1, Teapot.L1_5, Teapot.L3, Teapot.L5,
hosuaby/example-restful-project
src/main/java/io/hosuaby/restful/services/exceptions/teapots/TeapotsAlreadyExistException.java
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
import io.hosuaby.restful.domain.Teapot; import java.util.Collection; import java.util.stream.Stream;
package io.hosuaby.restful.services.exceptions.teapots; /** * Exception thrown when user tries to add teapots that already exist. */ public class TeapotsAlreadyExistException extends Exception { /** * When teapots with defined ids already exist. */ private static final String ERR_TEAPOTS_WITH_ID...
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
public TeapotsAlreadyExistException(Iterable<? extends Teapot> teapots) {
hosuaby/example-restful-project
src/main/java/io/hosuaby/restful/simulators/TeapotSimulator.java
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
import io.hosuaby.restful.domain.Teapot; import io.hosuaby.restful.domain.TeapotMessage; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; import javax.websocket.ClientEn...
/** * Handler for incoming messages. */ private static class TeapotSimulatorMessageHandler implements MessageHandler.Whole<String> { /** Teapot simulator object */ private TeapotSimulator simulator; /** Websocket session */ private Session session; ...
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
TeapotMessage msg;
hosuaby/example-restful-project
src/main/java/io/hosuaby/restful/services/TeapotCommandServiceImpl.java
// Path: src/main/java/io/hosuaby/restful/domain/TeapotMessage.java // public class TeapotMessage { // // /** Client id */ // private String clientId; // // /** Message payload */ // private String payload; // // public TeapotMessage() { // super(); // } // // public TeapotMessag...
import io.hosuaby.restful.domain.TeapotMessage; import io.hosuaby.restful.repositories.WebSocketSessionRepository; import io.hosuaby.restful.services.exceptions.teapots.TeapotInternalErrorException; import io.hosuaby.restful.services.exceptions.teapots.TeapotNotConnectedException; import java.io.IOException; import jav...
package io.hosuaby.restful.services; /** * Implementation of the {@link TeapotCommandService}. */ @Service // TODO: implement appropriate thread synchronization public class TeapotCommandServiceImpl implements TeapotCommandService { /** * Pattern for request id. Id must start with sequence "req-". ...
// Path: src/main/java/io/hosuaby/restful/domain/TeapotMessage.java // public class TeapotMessage { // // /** Client id */ // private String clientId; // // /** Message payload */ // private String payload; // // public TeapotMessage() { // super(); // } // // public TeapotMessag...
private WebSocketSessionRepository sessionRepository;
hosuaby/example-restful-project
src/main/java/io/hosuaby/restful/services/exceptions/teapots/TeapotsNotExistException.java
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
import io.hosuaby.restful.domain.Teapot; import java.util.Collection; import java.util.stream.Stream;
package io.hosuaby.restful.services.exceptions.teapots; /** * Exception thrown when one or many asked teapots not exist. */ public class TeapotsNotExistException extends Exception { /** * When teapots with defined ids not exist. */ private static final String ERR_TEAPOTS_WITH_IDS_NOT_EXISTS = "T...
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
public TeapotsNotExistException(Iterable<? extends Teapot> teapots) {
hosuaby/example-restful-project
src/main/java/io/hosuaby/restful/mappers/TeapotMapper.java
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
import io.hosuaby.restful.domain.Teapot; import io.hosuaby.restful.mappings.TeapotMapping; import io.hosuaby.restful.mappings.TeapotState; import java.util.Collection; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.MappingTarget;
package io.hosuaby.restful.mappers; /** * Mapper between {@link Teapot} and {@link TeapotMapping}. */ @Mapper(imports = TeapotState.class) public abstract class TeapotMapper { /** * Creates mapping from teapot. * * @param teapot teapot * * @return teapot mapping */ @Mapp...
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
public abstract TeapotMapping toMapping(Teapot teapot);
hosuaby/example-restful-project
src/main/java/io/hosuaby/restful/mappers/TeapotMapper.java
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
import io.hosuaby.restful.domain.Teapot; import io.hosuaby.restful.mappings.TeapotMapping; import io.hosuaby.restful.mappings.TeapotState; import java.util.Collection; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.MappingTarget;
package io.hosuaby.restful.mappers; /** * Mapper between {@link Teapot} and {@link TeapotMapping}. */ @Mapper(imports = TeapotState.class) public abstract class TeapotMapper { /** * Creates mapping from teapot. * * @param teapot teapot * * @return teapot mapping */ @Mapp...
// Path: src/main/java/io/hosuaby/restful/domain/Teapot.java // @Document(collection = "teapots") // public class Teapot { // // /** 0.3 L */ // public static final float L0_3 = (float) 0.3; // // /** 0.5 L */ // public static final float L0_5 = (float) 0.5; // // /** 1 L */ // public stati...
public abstract TeapotMapping toMapping(Teapot teapot);