Lombok:讓JAVA代碼更優(yōu)雅

Lombok:讓JAVA代碼更優(yōu)雅
關(guān)于Lombok,其實(shí)在網(wǎng)上可以找到很多如何使用的文章认境,但是很少能找到比較齊全的整理芍瑞。我也一直尋思著想寫一篇各個(gè)注解用法的總結(jié),但是一直都沒有付諸行動(dòng)藕帜。今天看到了微信公眾號(hào)”原力注入”推送的這篇文章,總結(jié)的內(nèi)容很全惜傲,所以分享給所有關(guān)注我博客的朋友們洽故。
背景
我們?cè)陂_發(fā)過程中,通常都會(huì)定義大量的JavaBean盗誊,然后通過IDE去生成其屬性的構(gòu)造器收津、getter、setter浊伙、equals撞秋、hashcode、toString方法嚣鄙,當(dāng)要對(duì)某個(gè)屬性進(jìn)行改變時(shí)吻贿,比如命名、類型等哑子,都需要重新去生成上面提到的這些方法舅列,那Java中有沒有一種方式能夠避免這種重復(fù)的勞動(dòng)呢?答案是有卧蜓,我們來(lái)看一下下面這張圖帐要,右面是一個(gè)簡(jiǎn)單的JavaBean,只定義了兩個(gè)屬性弥奸,在類上加上了@Data榨惠,從左面的結(jié)構(gòu)圖上可以看到,已經(jīng)自動(dòng)生成了上面提到的方法。

圖片.png

Lombok簡(jiǎn)介
Project Lombok makes java a spicier language by adding ‘handlers’ that know >how to build and compile simple, boilerplate-free, not-quite-java code.
如Github上項(xiàng)目介紹所言赠橙,Lombok項(xiàng)目通過添加“處理程序”耽装,使java成為一種更為簡(jiǎn)單的語(yǔ)言∑诰荆可以理解為掉奄,?Lombok是一個(gè)可以通過簡(jiǎn)單的注解形式來(lái)幫助我們簡(jiǎn)化消除一些必須有但顯得很臃腫的Java代碼的工具,通過使用對(duì)應(yīng)的注解凤薛,可以在編譯源碼的時(shí)候生成對(duì)應(yīng)的方法姓建。官方地址:https://projectlombok.org/,github地址:https://github.com/rzwitserloot/lombok缤苫; 作為一個(gè)Old Java Developer,我們都知道我們經(jīng)常需要定義一系列的套路引瀑,比如定義如下的格式對(duì)象。

public class DataExample {
      private final String name;
      private int age;
      private double score;
      private String[] tags;
  }

我們往往需要定義一系列的Get和Set方法最終展示形式如:

 public class DataExample {
      private final String name;
  private int age;
  private double score;
  private String[] tags;
  public DataExample(String name) {
    this.name = name;
  }
  public String getName() {
    return this.name;
  }
  void setAge(int age) {
    this.age = age;
  }
  public int getAge() {
    return this.age;
  }
  public void setScore(double score) {
    this.score = score;
  }
  public double getScore() {
    return this.score;
  }
  public String[] getTags() {
    return this.tags;
  }
  public void setTags(String[] tags) {
    this.tags = tags;
  }
}

那我們有沒有可以簡(jiǎn)化的辦法呢榨馁,第一種就是使用IDEA等IDE提供的一鍵生成的快捷鍵,第二種就是我們今天介紹的 Lombok項(xiàng)目:

@Data 
public class DataExample {
  private final String name;
  @Setter(AccessLevel.PACKAGE) 
  private int age;
  private double score;
  private String[] tags;
}

Wow…這樣就可以完成我們的需求帜矾,簡(jiǎn)直是太棒了翼虫,僅僅需要幾個(gè)注解,我們就擁有了完整的GetSet方法屡萤,還包含了ToString等方法的生成珍剑。

圖片.png

Lombok安裝
整個(gè)Lombok只有一個(gè)Jar包,可到這里下載:https://projectlombok.org/download
Lombok支持多種使用安裝方式死陆,這里我們講最常見的對(duì)兩大IDE的支持:
Eclipse (含延伸版本)
雙擊打開 lombok.jar (前提:你得裝了JDK), 可見如下頁(yè)面點(diǎn)擊 Install/Update:

圖片.png

恭喜你招拙,已經(jīng)安裝成功了。我們打開 Eclipse 的 About 頁(yè)面我們可以看見措译。

圖片.png

IntelliJ IDEA
定位到 File > Settings > Plugins
點(diǎn)擊 Browse repositories…
搜索 Lombok Plugin
點(diǎn)擊 Install plugin
重啟 IDEA
更多安裝請(qǐng)參考:https://projectlombok.org/
Lombok使用
Lombok 其實(shí)也不能算是一個(gè)特別新的項(xiàng)目别凤,從 2011 開始在中心倉(cāng)庫(kù)提供支持,現(xiàn)在也分為 stable 和 experimental 兩個(gè)版本领虹,本文側(cè)重介紹 stable 功能:
val
如果對(duì)其他的語(yǔ)言有研究的會(huì)發(fā)現(xiàn)规哪,很多語(yǔ)言是使用 var 作為變量申明,val作為常量申明塌衰。這里的val也是這個(gè)作用诉稍。

public String example() {
    val example = new ArrayList<String>();
    example.add("Hello, World!");
    val foo = example.get(0);
    return foo.toLowerCase();
}

翻譯成 Java 程序是:

public String example() {
    final ArrayList<String> example = new ArrayList<String>();
    example.add("Hello, World!");
    final String foo = example.get(0);
    return foo.toLowerCase();
}

作者注:也就是類型推導(dǎo)啦。
@NonNull
Null 即是罪惡

public class NonNullExample extends Something {
  private String name;
  
  public NonNullExample(@NonNull Person person) {
    super("Hello");
    this.name = person.getName();
  }
}

翻譯成 Java 程序是:

public class NonNullExample extends Something {
  private String name;
  
  public NonNullExample(@NonNull Person person) {
    super("Hello");
    if (person == null) {
      throw new NullPointerException("person");
    }
    this.name = person.getName();
  }
}

@Cleanup
自動(dòng)化才是生產(chǎn)力

public class CleanupExample {
  public static void main(String[] args) throws IOException {
    @Cleanup InputStream in = new FileInputStream(args[0]);
    @Cleanup OutputStream out = new FileOutputStream(args[1]);
    byte[] b = new byte[10000];
    while (true) {
      int r = in.read(b);
      if (r == -1) break;
      out.write(b, 0, r);
    }
  }
}

翻譯成 Java 程序是:

public class CleanupExample {
  public static void main(String[] args) throws IOException {
    InputStream in = new FileInputStream(args[0]);
    try {
      OutputStream out = new FileOutputStream(args[1]);
      try {
        byte[] b = new byte[10000];
        while (true) {
          int r = in.read(b);
          if (r == -1) break;
          out.write(b, 0, r);
        }
      } finally {
        if (out != null) {
          out.close();
        }
      }
    } finally {
      if (in != null) {
        in.close();
      }
    }
  }
}

作者注: JKD7里面就已經(jīng)提供 try with resource
@Getter/@Setter
可以作用在類上和屬性上最疆,放在類上杯巨,會(huì)對(duì)所有的非靜態(tài)(non-static)屬性生成Getter/Setter方法,放在屬性上努酸,會(huì)對(duì)該屬性生成Getter/Setter方法服爷。并可以指定Getter/Setter方法的訪問級(jí)別。
再也不寫 public int getFoo() {return foo;}

public class GetterSetterExample {
  @Getter @Setter private int age = 10;
  
  @Setter(AccessLevel.PROTECTED) private String name;
  
  @Override public String toString() {
    return String.format("%s (age: %d)", name, age);
  }
}

翻譯成 Java 程序是:

public class GetterSetterExample {
  private int age = 10;
  private String name;
  
  @Override public String toString() {
    return String.format("%s (age: %d)", name, age);
  }
  
  public int getAge() {
    return age;
  }
  
  public void setAge(int age) {
    this.age = age;
  }
  
  protected void setName(String name) {
    this.name = name;
  }
}

@ToString
生成toString方法,默認(rèn)情況下层扶,會(huì)輸出類名箫章、所有屬性,屬性會(huì)按照順序輸出镜会,以逗號(hào)分割檬寂。
Debug Log 最強(qiáng)幫手

@ToString(exclude="id")
public class ToStringExample {
  private static final int STATIC_VAR = 10;
  private String name;
  private Shape shape = new Square(5, 10);
  private String[] tags;
  private int id;
  
  public String getName() {
    return this.getName();
  }
  
  @ToString(callSuper=true, includeFieldNames=true)
  public static class Square extends Shape {
    private final int width, height;
    
    public Square(int width, int height) {
      this.width = width;
      this.height = height;
    }
  }
}

翻譯后:

public class ToStringExample {
  private static final int STATIC_VAR = 10;
  private String name;
  private Shape shape = new Square(5, 10);
  private String[] tags;
  private int id;
  
  public String getName() {
    return this.getName();
  }
  
  public static class Square extends Shape {
    private final int width, height;
    
    public Square(int width, int height) {
      this.width = width;
      this.height = height;
    }
    
    @Override public String toString() {
      return "Square(super=" + super.toString() + ", width=" + this.width + ", height=" + this.height + ")";
    }
  }
  
  @Override public String toString() {
    return "ToStringExample(" + this.getName() + ", " + this.shape + ", " + Arrays.deepToString(this.tags) + ")";
  }
}

作者注:其實(shí)和 org.apache.commons.lang3.builder.ReflectionToStringBuilder 很像。
@NoArgsConstructor, @RequiredArgsConstructor and @AllArgsConstructor
?無(wú)參構(gòu)造器戳表、部分參數(shù)構(gòu)造器桶至、全參構(gòu)造器,當(dāng)我們需要重載多個(gè)構(gòu)造器的時(shí)候匾旭,Lombok就無(wú)能為力了镣屹。

@RequiredArgsConstructor(staticName = "of")
@AllArgsConstructor(access = AccessLevel.PROTECTED)
public class ConstructorExample<T> {
  private int x, y;
  @NonNull private T description;
  
  @NoArgsConstructor
  public static class NoArgsExample {
    @NonNull private String field;
  }
}

翻譯后:

public class ConstructorExample<T> {
  private int x, y;
  @NonNull private T description;
  
  private ConstructorExample(T description) {
    if (description == null) throw new NullPointerException("description");
    this.description = description;
  }
  
  public static <T> ConstructorExample<T> of(T description) {
    return new ConstructorExample<T>(description);
  }
  
  @java.beans.ConstructorProperties({"x", "y", "description"})
  protected ConstructorExample(int x, int y, T description) {
    if (description == null) throw new NullPointerException("description");
    this.x = x;
    this.y = y;
    this.description = description;
  }
  
  public static class NoArgsExample {
    @NonNull private String field;
    
    public NoArgsExample() {
    }
  }
}

@Data
這個(gè)就相當(dāng)?shù)暮?jiǎn)單啦,因?yàn)槲覀儼l(fā)現(xiàn)@ToString, @EqualsAndHashCode, @Getter 都很常用价涝,這個(gè)一個(gè)注解就相當(dāng)于
@ToString
@EqualsAndHashCode
@Getter(所有字段)
@Setter (所有非final字段)
@RequiredArgsConstructor
@Value

    @Value public class ValueExample {
  String name;
  @Wither(AccessLevel.PACKAGE) @NonFinal int age;
  double score;
  protected String[] tags;
  
  @ToString(includeFieldNames=true)
  @Value(staticConstructor="of")
  public static class Exercise<T> {
    String name;
    T value;
  }
}

翻譯后:

public final class ValueExample {
  private final String name;
  private int age;
  private final double score;
  protected final String[] tags;
  
  @java.beans.ConstructorProperties({"name", "age", "score", "tags"})
  public ValueExample(String name, int age, double score, String[] tags) {
    this.name = name;
    this.age = age;
    this.score = score;
    this.tags = tags;
  }
  
  public String getName() {
    return this.name;
  }
  
  public int getAge() {
    return this.age;
  }
  
  public double getScore() {
    return this.score;
  }
  
  public String[] getTags() {
    return this.tags;
  }
  
  @java.lang.Override
  public boolean equals(Object o) {
    if (o == this) return true;
    if (!(o instanceof ValueExample)) return false;
    final ValueExample other = (ValueExample)o;
    final Object this$name = this.getName();
    final Object other$name = other.getName();
    if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false;
    if (this.getAge() != other.getAge()) return false;
    if (Double.compare(this.getScore(), other.getScore()) != 0) return false;
    if (!Arrays.deepEquals(this.getTags(), other.getTags())) return false;
    return true;
  }
  
  @java.lang.Override
  public int hashCode() {
    final int PRIME = 59;
    int result = 1;
    final Object $name = this.getName();
    result = result * PRIME + ($name == null ? 43 : $name.hashCode());
    result = result * PRIME + this.getAge();
    final long $score = Double.doubleToLongBits(this.getScore());
    result = result * PRIME + (int)($score >>> 32 ^ $score);
    result = result * PRIME + Arrays.deepHashCode(this.getTags());
    return result;
  }
  
  @java.lang.Override
  public String toString() {
    return "ValueExample(name=" + getName() + ", age=" + getAge() + ", score=" + getScore() + ", tags=" + Arrays.deepToString(getTags()) + ")";
  }
  
  ValueExample withAge(int age) {
    return this.age == age ? this : new ValueExample(name, age, score, tags);
  }
  
  public static final class Exercise<T> {
    private final String name;
    private final T value;
    
    private Exercise(String name, T value) {
      this.name = name;
      this.value = value;
    }
    
    public static <T> Exercise<T> of(String name, T value) {
      return new Exercise<T>(name, value);
    }
    
    public String getName() {
      return this.name;
    }
    
    public T getValue() {
      return this.value;
    }
    
    @java.lang.Override
    public boolean equals(Object o) {
      if (o == this) return true;
      if (!(o instanceof ValueExample.Exercise)) return false;
      final Exercise<?> other = (Exercise<?>)o;
      final Object this$name = this.getName();
      final Object other$name = other.getName();
      if (this$name == null ? other$name != null : !this$name.equals(other$name)) return false;
      final Object this$value = this.getValue();
      final Object other$value = other.getValue();
      if (this$value == null ? other$value != null : !this$value.equals(other$value)) return false;
      return true;
    }
    
    @java.lang.Override
    public int hashCode() {
      final int PRIME = 59;
      int result = 1;
      final Object $name = this.getName();
      result = result * PRIME + ($name == null ? 43 : $name.hashCode());
      final Object $value = this.getValue();
      result = result * PRIME + ($value == null ? 43 : $value.hashCode());
      return result;
    }
    
    @java.lang.Override
    public String toString() {
      return "ValueExample.Exercise(name=" + getName() + ", value=" + getValue() + ")";
    }
  }
}

我們發(fā)現(xiàn)了 @Value 就是 @Data 的不可變版本女蜈。至于不可變有什么好處∩瘢可有參看此篇(https://blogs.msdn.microsoft.com/ericlippert/2007/11/13/immutability-in-c-part-one-kinds-of-immutability/
@Builder
我的最愛

@Builder
public class BuilderExample {
  private String name;
  private int age;
  @Singular private Set<String> occupations;
}

翻譯后:

public class BuilderExample {
  private String name;
  private int age;
  private Set<String> occupations;
  
  BuilderExample(String name, int age, Set<String> occupations) {
    this.name = name;
    this.age = age;
    this.occupations = occupations;
  }
  
  public static BuilderExampleBuilder builder() {
    return new BuilderExampleBuilder();
  }
  
  public static class BuilderExampleBuilder {
    private String name;
    private int age;
    private java.util.ArrayList<String> occupations;
    
    BuilderExampleBuilder() {
    }
    
    public BuilderExampleBuilder name(String name) {
      this.name = name;
      return this;
    }
    
    public BuilderExampleBuilder age(int age) {
      this.age = age;
      return this;
    }
    
    public BuilderExampleBuilder occupation(String occupation) {
      if (this.occupations == null) {
        this.occupations = new java.util.ArrayList<String>();
      }
      
      this.occupations.add(occupation);
      return this;
    }
    
    public BuilderExampleBuilder occupations(Collection<? extends String> occupations) {
      if (this.occupations == null) {
        this.occupations = new java.util.ArrayList<String>();
      }
      this.occupations.addAll(occupations);
      return this;
    }
    
    public BuilderExampleBuilder clearOccupations() {
      if (this.occupations != null) {
        this.occupations.clear();
      }
      
      return this;
    }
    public BuilderExample build() {
      // complicated switch statement to produce a compact properly sized immutable set omitted.
      // go to https://projectlombok.org/features/Singular-snippet.html to see it.
      Set<String> occupations = ...;
      return new BuilderExample(name, age, occupations);
    }
    
    @java.lang.Override
    public String toString() {
      return "BuilderExample.BuilderExampleBuilder(name = " + this.name + ", age = " + this.age + ", occupations = " + this.occupations + ")";
    }
  }
}

builder是現(xiàn)在比較推崇的一種構(gòu)建值對(duì)象的方式伪窖。
作者注:生成器模式
@SneakyThrows
to RuntimeException 小助手

    public class SneakyThrowsExample implements Runnable {
  @SneakyThrows(UnsupportedEncodingException.class)
  public String utf8ToString(byte[] bytes) {
    return new String(bytes, "UTF-8");
  }
  
  @SneakyThrows
  public void run() {
    throw new Throwable();
  }
}

翻譯后

public class SneakyThrowsExample implements Runnable {
  public String utf8ToString(byte[] bytes) {
    try {
      return new String(bytes, "UTF-8");
    } catch (UnsupportedEncodingException e) {
      throw Lombok.sneakyThrow(e);
    }
  }
  
  public void run() {
    try {
      throw new Throwable();
    } catch (Throwable t) {
      throw Lombok.sneakyThrow(t);
    }
  }
}

很好的隱藏了異常,有時(shí)候的確會(huì)有這樣的煩惱居兆,從某種程度上也是遵循的了 let is crash

@Synchronized
public class SynchronizedExample {
  private final Object readLock = new Object();
  
  @Synchronized
  public static void hello() {
    System.out.println("world");
  }
  
  @Synchronized
  public int answerToLife() {
    return 42;
  }
  
  @Synchronized("readLock")
  public void foo() {
    System.out.println("bar");
  }
}

翻譯后

public class SynchronizedExample {
  private static final Object $LOCK = new Object[0];
  private final Object $lock = new Object[0];
  private final Object readLock = new Object();
  
  public static void hello() {
    synchronized($LOCK) {
      System.out.println("world");
    }
  }
  
  public int answerToLife() {
    synchronized($lock) {
      return 42;
    }
  }
  
  public void foo() {
    synchronized(readLock) {
      System.out.println("bar");
    }
  }
}

這個(gè)就比較簡(jiǎn)單直接添加了synchronized關(guān)鍵字就Ok啦覆山。不過現(xiàn)在JDK也比較推薦的是 Lock 對(duì)象,這個(gè)可能用的不是特別多泥栖。
@Getter(lazy=true)
節(jié)約是美德

public class GetterLazyExample {
  @Getter(lazy=true) private final double[] cached = expensive();
  
  private double[] expensive() {
    double[] result = new double[1000000];
    for (int i = 0; i < result.length; i++) {
      result[i] = Math.asin(i);
    }
    return result;
  }
}

翻譯后:

    public class GetterLazyExample {
  private final java.util.concurrent.AtomicReference<java.lang.Object> cached = new java.util.concurrent.AtomicReference<java.lang.Object>();
  
  public double[] getCached() {
    java.lang.Object value = this.cached.get();
    if (value == null) {
      synchronized(this.cached) {
        value = this.cached.get();
        if (value == null) {
          final double[] actualValue = expensive();
          value = actualValue == null ? this.cached : actualValue;
          this.cached.set(value);
        }
      }
    }
    return (double[])(value == this.cached ? null : value);
  }
  
  private double[] expensive() {
    double[] result = new double[1000000];
    for (int i = 0; i < result.length; i++) {
      result[i] = Math.asin(i);
    }
    return result;
  }
}

@Log
再也不用寫那些差不多的LOG啦

@Log
public class LogExample {
  
  public static void main(String... args) {
    log.error("Something's wrong here");
  }
}

@Slf4j
public class LogExampleOther {
  
  public static void main(String... args) {
    log.error("Something else is wrong here");
  }
}

@CommonsLog(topic="CounterLog")
public class LogExampleCategory {
  public static void main(String... args) {
    log.error("Calling the 'CounterLog' with a message");
  }
}

翻譯后:

public class LogExample {
  private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(LogExample.class.getName());
  
  public static void main(String... args) {
    log.error("Something's wrong here");
  }
}

public class LogExampleOther {
  private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(LogExampleOther.class);
  
  public static void main(String... args) {
    log.error("Something else is wrong here");
  }
}

public class LogExampleCategory {
  private static final org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog("CounterLog");
  public static void main(String... args) {
    log.error("Calling the 'CounterLog' with a message");
  }
}

Lombok原理
說道 Lombok簇宽,我們就得去提到 JSR 269: Pluggable Annotation Processing API (https://www.jcp.org/en/jsr/detail?id=269) 。JSR 269 之前我們也有注解這樣的神器吧享,可是我們比如想要做什么必須使用反射魏割,反射的方法局限性較大。首先钢颂,它必須定義@Retention為RetentionPolicy.RUNTIME见妒,只能在運(yùn)行時(shí)通過反射來(lái)獲取注解值,使得運(yùn)行時(shí)代碼效率降低甸陌。其次须揣,如果想在編譯階段利用注解來(lái)進(jìn)行一些檢查,對(duì)用戶的某些不合理代碼給出錯(cuò)誤報(bào)告钱豁,反射的使用方法就無(wú)能為力了耻卡。而 JSR 269 之后我們可以在 Javac的編譯期利用注解做這些事情。所以我們發(fā)現(xiàn)核心的區(qū)分是在 運(yùn)行期 還是 編譯期牲尺。

圖片.png

從上圖可知卵酪,Annotation Processing 是在解析和生成之間的一個(gè)步驟幌蚊。

圖片.png

上圖是 Lombok 處理流程,在Javac 解析成抽象語(yǔ)法樹之后(AST), Lombok 根據(jù)自己的注解處理器溃卡,動(dòng)態(tài)的修改 AST溢豆,增加新的節(jié)點(diǎn)(所謂代碼),最終通過分析和生成字節(jié)碼瘸羡。
關(guān)于原理我們大致上的描述下漩仙,如果有興趣可以參考下方文檔。
jdk-compilation-overview
Project Lombok: Creating Custom Transformations
Lombok問題
無(wú)法支持多種參數(shù)構(gòu)造器的重載犹赖。

參考:

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末队他,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子峻村,更是在濱河造成了極大的恐慌麸折,老刑警劉巖,帶你破解...
    沈念sama閱讀 221,406評(píng)論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件粘昨,死亡現(xiàn)場(chǎng)離奇詭異垢啼,居然都是意外死亡,警方通過查閱死者的電腦和手機(jī)张肾,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,395評(píng)論 3 398
  • 文/潘曉璐 我一進(jìn)店門芭析,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái),“玉大人捌浩,你說我怎么就攤上這事」ぶ龋” “怎么了尸饺?”我有些...
    開封第一講書人閱讀 167,815評(píng)論 0 360
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)助币。 經(jīng)常有香客問我浪听,道長(zhǎng),這世上最難降的妖魔是什么眉菱? 我笑而不...
    開封第一講書人閱讀 59,537評(píng)論 1 296
  • 正文 為了忘掉前任迹栓,我火速辦了婚禮,結(jié)果婚禮上俭缓,老公的妹妹穿的比我還像新娘克伊。我一直安慰自己,他們只是感情好华坦,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,536評(píng)論 6 397
  • 文/花漫 我一把揭開白布愿吹。 她就那樣靜靜地躺著,像睡著了一般惜姐。 火紅的嫁衣襯著肌膚如雪犁跪。 梳的紋絲不亂的頭發(fā)上椿息,一...
    開封第一講書人閱讀 52,184評(píng)論 1 308
  • 那天,我揣著相機(jī)與錄音坷衍,去河邊找鬼寝优。 笑死,一個(gè)胖子當(dāng)著我的面吹牛枫耳,可吹牛的內(nèi)容都是我干的乏矾。 我是一名探鬼主播,決...
    沈念sama閱讀 40,776評(píng)論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼嘉涌,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼妻熊!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起仑最,我...
    開封第一講書人閱讀 39,668評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤扔役,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后警医,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體亿胸,經(jīng)...
    沈念sama閱讀 46,212評(píng)論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,299評(píng)論 3 340
  • 正文 我和宋清朗相戀三年预皇,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了侈玄。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,438評(píng)論 1 352
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡吟温,死狀恐怖序仙,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情鲁豪,我是刑警寧澤潘悼,帶...
    沈念sama閱讀 36,128評(píng)論 5 349
  • 正文 年R本政府宣布,位于F島的核電站爬橡,受9級(jí)特大地震影響治唤,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜糙申,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,807評(píng)論 3 333
  • 文/蒙蒙 一宾添、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧柜裸,春花似錦缕陕、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,279評(píng)論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至衔统,卻和暖如春鹿榜,著一層夾襖步出監(jiān)牢的瞬間海雪,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,395評(píng)論 1 272
  • 我被黑心中介騙來(lái)泰國(guó)打工舱殿, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留奥裸,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,827評(píng)論 3 376
  • 正文 我出身青樓沪袭,卻偏偏與公主長(zhǎng)得像湾宙,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子冈绊,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,446評(píng)論 2 359

推薦閱讀更多精彩內(nèi)容