Commit 7ecbec5b by yuwei

Java设计模式

parent 2f75acc5
...@@ -5,7 +5,7 @@ import cn.datax.learning.design.patterns.creational.factory.*; ...@@ -5,7 +5,7 @@ import cn.datax.learning.design.patterns.creational.factory.*;
public class ColorFactory extends AbstractFactory { public class ColorFactory extends AbstractFactory {
@Override @Override
Color getColor(String color) { public Color getColor(String color) {
if (color == null){ if (color == null){
return null; return null;
} }
...@@ -20,7 +20,7 @@ public class ColorFactory extends AbstractFactory { ...@@ -20,7 +20,7 @@ public class ColorFactory extends AbstractFactory {
} }
@Override @Override
Shape getShape(String shapeType) { public Shape getShape(String shapeType) {
return null; return null;
} }
} }
...@@ -5,12 +5,12 @@ import cn.datax.learning.design.patterns.creational.factory.*; ...@@ -5,12 +5,12 @@ import cn.datax.learning.design.patterns.creational.factory.*;
public class ShapeFactory extends AbstractFactory { public class ShapeFactory extends AbstractFactory {
@Override @Override
Color getColor(String color) { public Color getColor(String color) {
return null; return null;
} }
@Override @Override
Shape getShape(String shapeType) { public Shape getShape(String shapeType) {
if (shapeType == null) { if (shapeType == null) {
return null; return null;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment