Skip to content

Instantly share code, notes, and snippets.

t.nemoto.x kuneo

Block or report user

Report or block kuneo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View bean validation test
(import snip)
public class BeanValidationTest {
private Validator validator;
@Before
public void init() {
// バリデータを生成する
ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory();
View DigitsTypeUse
package kuneo.org.sample.typeuse;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import javax.validation.Constraint;
View mockito_maven
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.10.19</version>
</dependency>
@kuneo
kuneo / mockito_試験クラス
Last active Sep 30, 2016
mockito説明用試験クラス
View mockito_試験クラス
package kuneo.org.sample.mockito;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import javax.naming.AuthenticationException;
@kuneo
kuneo / mockito_RepositoryIF
Last active Sep 30, 2016
mockito説明用、試験対象クラス
View mockito_RepositoryIF
public interface LoginRepository {
String findHashPassword(String loginId);
}
View bidimapバージョン
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.1</version>
</dependency>
@kuneo
kuneo / bidimap出力結果
Created Sep 29, 2016
bidimapの出力結果
View bidimap出力結果
suzuki
1
--- 拡張for文を回してみる ---
key:suzuki
value:1
key:sato
value:3
key:yamada
value:2
@kuneo
kuneo / bidimapサンプルコード
Last active Sep 29, 2016
apache commonsのBidiMap(双方向マップ)の使い方
View bidimapサンプルコード
// 通常のマップを生成
Map<String, Integer> map = new HashMap<>();
map.put("suzuki", 1);
map.put("tanaka", 2);
// 生成した通常のマップを双方向マップに挿入
BidiMap<String, Integer> bidiMap = new DualHashBidiMap<>(map);
// getKey()でvalueからkeyを取得できる
System.out.println(bidiMap.getKey(1));
// 当然、get()でkeyからvalueも取得できる
@kuneo
kuneo / table-classes.html
Created Jun 28, 2016
bootstrap-table table[classes]
View table-classes.html
<table data-toggle="table" data-url="http://kuneo.org/sandbox/bootstrap-table/json/getstart.json" data-classes="table table-hover table-no-bordered">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">名前</th>
<th data-field="price">価格</th>
</tr>
</thead>
</table>
@kuneo
kuneo / step.html
Created Jun 23, 2016
bootstrap-table step
View step.html
<table id="table"></table>
<script>
$('#table').bootstrapTable({
url: 'http://kuneo.org/sandbox/bootstrap-table/json/getstart.json',
columns: [{
field: 'id',
title: 'ID'
}, {
field: 'name',
title: '名前'
You can’t perform that action at this time.