This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import snip) | |
public class BeanValidationTest { | |
private Validator validator; | |
@Before | |
public void init() { | |
// バリデータを生成する | |
ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.mockito</groupId> | |
<artifactId>mockito-all</artifactId> | |
<version>1.10.19</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface LoginRepository { | |
String findHashPassword(String loginId); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.apache.commons</groupId> | |
<artifactId>commons-collections4</artifactId> | |
<version>4.1</version> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
suzuki | |
1 | |
--- 拡張for文を回してみる --- | |
key:suzuki | |
value:1 | |
key:sato | |
value:3 | |
key:yamada | |
value:2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 通常のマップを生成 | |
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も取得できる |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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: '名前' |
NewerOlder