Java

Table of Contents

Java

Interface

interface内ではmethodはpublic fieldはpublic static final

default句で実装をかける。

String

文字列結合

  • > StringBuffer > StringBuilder

Stringはimmutablec

IntelliJ

操作 デフォルト カスタマイズ
import最適化 C-alt-o C-Shift-o
設定画面 Command-,  
Text top   Shift-Alt-.
Text bottom   Shift-Alt-,
next error highlight   C-c C-n
previous error highlight   C-c C-p

maven

skip test

mvn install -DskipTests

mail

interface

keytool

$ keytool -v --list -keystore  /usr/lib/jvm/java-1.8.0-openjdk/jre/lib/security/cacerts
# password は changeit

$ keytool -v --list -keystore  /usr/lib/jvm/java-1.8.0-openjdk/jre/lib/security/cacerts
Enter keystore password:

Keystore type: JKS
Keystore provider: SUN

Your keystore contains 159 entries

Alias name: extra-tanxc3xbasxc3xadtvxc3xa1nykiadxc3xb3kcertificationservicesnetlockaranyclassgoldfxc5x91tanxc3xbasxc3xadtvxc3xa1ny
Creation date: Oct 17, 2015
Entry type: trustedCertEntry

Owner: CN=NetLock Arany (Class Gold) Főtanúsítvány, OU=Tanúsítványkiadók (Certification Services), O=NetLock Kft., L=Budapest, C=HU
Issuer: CN=NetLock Arany (Class Gold) Főtanúsítvány, OU=Tanúsítványkiadók (Certification Services), O=NetLock Kft., L=Budapest, C=HU
Serial number: 49412ce40010
Valid from: Fri Dec 12 00:08:21 JST 2008 until: Thu Dec 07 00:08:21 JST 2028
Certificate fingerprints:
         MD5:  C5:A1:B7:FF:73:DD:D6:D7:34:32:18:DF:FC:3C:AD:88
         SHA1: 06:08:3F:59:3F:15:A1:04:A0:69:A4:6B:A9:03:D0:06:B7:97:09:91
         SHA256: 6C:61:DA:C3:A2:DE:F0:31:50:6B:E0:36:D2:A6:FE:40:19:94:FB:D1:3D:F9:C8:D4:66:59:92:74:C4:46:EC:98
         Signature algorithm name: SHA256withRSA
         Version: 3

logback設定

http://javazuki.com/articles/slf4j-logback-usage.html https://qiita.com/opengl-8080/items/49719f2d35171f017aa9

<appenderタグ>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
        <pattern>%d{HH:mm:ss.SSS} %-5level %logger{35} - %msg %n</pattern>
    </encoder>
</appender>

<loggerタグ> nameに対象となるロガーを設定する

<logger name="gside.org" level="INFO">
  <appender-ref ref="STDOUT" />
</logger>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE logback>
<configuration>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} %-5level %logger{35} - %msg %n</pattern>
        </encoder>
    </appender>

    <logger name="org.gside" level="INFO">
        <appender-ref ref="STDOUT" />
    </logger>

</configuration>

Validate