This file contains hidden or 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
# Created by .gitignore support plugin (hsz.mobi) | |
.idea/libraries/* | |
.idea/workspace.xml | |
### Maven template | |
target/ | |
pom.xml.tag | |
pom.xml.releaseBackup | |
pom.xml.versionsBackup | |
pom.xml.next |
This file contains hidden or 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 com.xenoterracide.rpf.abstracts; | |
import org.hibernate.annotations.GenericGenerator; | |
import org.hibernate.annotations.Type; | |
import org.springframework.data.jpa.domain.AbstractPersistable; | |
import javax.persistence.Column; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.Id; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Entity<ID> { | |
ID getId(); | |
setId( ID id ); | |
} | |
class Repository<ID, ENTITY extends Entity<ID>> { | |
Map<ID, ENTITY> identityMap = new HashMap<>(); | |
void add( ENTITY entity ) { | |
identityMap.put( entity.getId(), entity ); |
This file contains hidden or 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
class InfoLogger { | |
Logger log = LoggerFactory.getLogger(InfoLogger.class); | |
@Override | |
void log( String message ) { | |
log.info( message ); | |
} | |
} | |
class DebugLogger { |
This file contains hidden or 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
class Logged { | |
public static void exec ( Function<String,Void> log ) { | |
log.apply("hello world"); | |
} | |
} | |
Logged.exec( s -> System.out.println(s) ); | |
Logged.exec( s -> log.info(s) ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Logger { | |
default void log(String message ) { | |
_logger().info( message ); | |
} | |
Logger _logger(); | |
} | |
class InfoLogger implements Logger | |
Logger log = LoggerFactory.getLogger(InfoLogger.class); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Logger { | |
void log(String message ); | |
} | |
class InfoLogger implements Logger { | |
Logger log = LoggerFactory.getLogger(InfoLogger.class); | |
@Override | |
void log( String message ) { | |
log.info( message ); |
This file contains hidden or 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
// this is a bad idea, juse use slf4j | |
class SimpleLogger { | |
void log( String message ) { | |
System.out.println(getClass() + message ); | |
} | |
} | |
class InfoLogger extends SimpleLogger { | |
Logger log = LoggerFactory.getLogger(LogOne.class); |
This file contains hidden or 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
HTTP/1.1 200 OK | |
Server: Apache-Coyote/1.1 | |
Content-Type: application/hal+json | |
Transfer-Encoding: chunked | |
Date: Wed, 03 Sep 2014 02:21:49 GMT | |
{ | |
"_links" : { | |
"task" : { | |
"href" : "http://localhost:8080/task{?page,size,sort}", |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.lm</groupId> | |
<artifactId>lm</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<parent> |